語法:
#include <stdio.h>
#include <stdlib.h>
typedef struct DATA{
long S_NO; //學號
/*作業成績*/
int math;
int C_Lang;
int En;
int Total
}Student_Data;
int main(int argc, char *argv[])
{
Student_Data s[5]; //一維陣列
//...輸入及計算
system("PAUSE");
return 0;
}
至於用 二維陣列 設計
語法:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
long s[5][4]; //二維陣列
/*
s[0][0] 表示: 學號800701 的數學成績
s[0][1] 表示: 學號800701 的C語言成績
s[0][2] 表示: 學號800701 的英文成績
s[0][3] 表示: 學號800701 的總分
*/
//...輸入及計算
system("PAUSE");
return 0;
}