您所在的位置:Seago-Microsoft Windows>>Windows管理脚本>> 关于C语言的问题

关于C语言的问题

作者:网友 来源:雅虎知识堂 日期:2008-04-10 

关于C语言的问题

1.输入(或采用初始化}、输出一个有三个学生五门功课的二维表。

51 52 53 54 55
61 62 63 64 65
71 72 73 74 75

2.查找第二个学生的所有成绩,并输出。
3.求出第三门课程的平均成绩。
注:最好用函数调用实现,可采用全局数组。


电脑问题网给出的最佳答案

#include <stdio.h>
int a[3][5]={{51,52,53,54,55},{61,62,63,64,65},{71,72,73,74,75}};
main(){
getSecondStuAll();
getAverage3();
getch();
}
getSecondStuAll(){
int i;
printf("The second Student's:");
for(i=0;i<5;i )
printf("%d ",a[1][i]);
printf("\n");
}
getAverage3(){
int i;
float f;
i = a[0][2] a[1][2] a[2][2];
f = (float)(i/3);
printf("the average is: %f",f);
}


很简单的问题.只要用上半身好好想想就能做出来.


我知道很简单啊,问题是我要是知道我还用问吗?


好好想啊,很简单啊