C语言输入某学生3个学科成绩 输出成绩 总分和平均分

[复制链接]
查看11 | 回复3 | 2010-7-19 20:18:44 | 显示全部楼层 |阅读模式
#includevoid main(){ int a[5]; int b,c,d=0;a[3]=0; printf("\n输入学生三门功课成绩:"); for(b=0;bmain(){float a,b,c,sum,avg;printf("输入该学生的3课成绩:");scanf("%f,%f,%f",&a,&b,&c);sum=a+b+c;avg=sum/3;printf("语文成绩为 %.1f",a);printf("数学成绩为 %.1f",
回复

使用道具 举报

千问 | 2010-7-19 20:18:44 | 显示全部楼层
#include "stdio.h"#define N 3void main(){double sub[N],ave,sum=0;int i;printf("Input %d score:\n",N);for(i=0;i<N;i++){scanf("%lf",&sub);suum+=sub;}a
回复

使用道具 举报

千问 | 2010-7-19 20:18:44 | 显示全部楼层
来晚了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行