知识库

C语言开发示例:04. 简单计算

2025-02-01 20:03:27 李腾 1 次阅读

simple_calculation.c

#include <stdio.h>

int main()
{
    int total_pets;
    int cats;
    int dogs;
    int ponies;
    int others;

    cats = 2;
    dogs = 1;
    ponies = 1;
    others = 46;

    total_pets = cats + dogs + ponies + others;

    printf("We have %d pets in total\n", total_pets);

    return 0;
}
转载请注明转自www.hylab.cn,原文地址:C语言开发示例:04. 简单计算

评论 (0)

登录后发表评论

暂无评论,快来发表第一条评论吧!