有N名學生(N的值由符號常量定義),學生的資訊包含:學號、姓名、5門課程成績和總成績),輸入每個學生的相關資訊,統計每個學生的總成績及N名學生總成績的平均值,最后輸出每名學生的所有資訊及N名學生總成績的平均值。
uj5u.com熱心網友回復:
求助求助求助uj5u.com熱心網友回復:
是要輸入N嗎uj5u.com熱心網友回復:
用結構體陣列。struct student
{
char xh[15];
char name[20];
int score1;
int score2;
int score3;
int score4;
int score5;
int total;
} STU;
STU array[10];
類似這樣,其余操作和陣列一樣
uj5u.com熱心網友回復:
struct student{
int number,s1,s2,s3,s4,s5;
string name;
}
uj5u.com熱心網友回復:
對 用戶輸入nuj5u.com熱心網友回復:
謝謝轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/78790.html
標籤:C++ 語言
