###### 弗兰随风小欢

2015-11-08 08:29 阅读 5.9k

# 怎么用c语言来做这个问题？

/**已知某位学生的数学、英语和计算机课程的成绩分别是87分、72分和93分，求该生3门课程的平均成绩。

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

• 点赞
• 写回答
• 关注问题
• 收藏
• 复制链接分享

#### 5条回答默认 最新

• 已采纳
jifengyishan 2015-11-08 08:41

#include
void main()
{
int math=87;
int english=72;
int computer=93;
float average=0;
int sum=math+english+computer;
average=sum/3;
printf("math=%d,eng=%d,comp=%d,average=%f\n",math,english,computer,average);
}

点赞 2 评论 复制链接分享
• joce1en 2015-11-09 11:18

#include
void main()
{
int math = 87, eng = 72, comp = 93;
float average;
average=(math+eng+comp)/3;
printf("math=%d,eng=%d，average = %d\n",math ,eng,average);
}
楼主好好学习

点赞 2 评论 复制链接分享
• lipv 2015-11-08 08:41

#include

void main()
{
int math = 87, eng = 72, comp = 93;
int average;
printf("average = %d\n",(math+eng+comp)/3);
}
大学新生？还是高中生？
自己好好学！

点赞 1 评论 复制链接分享
• boss761453073 2015-11-08 08:55

#include
int main()
{
int math = 87, eng = 72, comp = 93;
float average;
average=(math+eng+comp)/3;
printf("math=%d,eng=%d,comp=%d,average=%.2f\n",math,eng,comp,average);
}

点赞 1 评论 复制链接分享
• boss761453073 2015-11-08 08:55

#include
int main()
{
int math = 87, eng = 72, comp = 93;
float average;
average=(math+eng+comp)/3;
printf("math=%d,eng=%d,comp=%d,average=%.2f\n",math,eng,comp,average);
}

点赞 1 评论 复制链接分享