通过几组数算平均数

来源:互联网 发布:淘宝网折叠餐桌 编辑:程序博客网 时间:2024/05/29 13:43
#include <stdio.h>int main(){    int score1,score2,score3,score4,score5;    int totalscore;    printf("Input the score of five students:\n");    scanf("%d",&score1);    scanf("%d",&score2);    scanf("%d",&score3);    scanf("%d",&score4);    scanf("%d",&score5);    totalscore =score1+score2+score3+score4+score5;    printf("The average score is %f\n",totalscore/5.0);    return 0;}

运算结果如下

懂得算几个数的平均数.

原创粉丝点击