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

2024-07-10 09:23:24 2025-02-01 20:03:27 李腾 24 次阅读 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优化,请仔细甄别,转载请注明转自www.hylab.cn,原文地址:C语言开发示例:04. 简单计算

评论 (0)

登录后发表评论

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