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

2024-07-10 李腾 46 次阅读 0 次点赞

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;
}
本文由人工编写,AI优化,转载请注明原文地址: C语言开发示例:04. 简单计算

评论 (0)

登录后发表评论

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