c语言编程 7-11 计算平均分
作者:yunjinqi   类别:    日期:2023-05-29 10:04:34    阅读:130 次   消耗积分:0 分    

已知某位学生的数学、英语和计算机课程的成绩分别是87分、72分和93分,求该生3门课程的平均成绩(结果按整型输出)。

输入格式:

本题无输入


输出格式:

按照下列格式输出结果:

math = 87, eng = 72, comp = 93, average = 计算所得的平均成绩

代码长度限制16 KB时间限制400 ms内存限制64 MB

#include <stdio.h>
int main(){
    int math = 87, eng = 72, comp = 93;
    int average = (math+eng+comp)/3;
    printf("math = %d, eng = %d, comp = %d, average = %d",math,eng,comp,average);
    return 0;
}


版权所有,转载本站文章请注明出处:云子量化, http://www.woniunote.com/article/136
上一篇:7-10 算术入门之加减乘除
下一篇:C语言编程 7-12 日期格式化