返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name[5]={"王大明","李大頭","蘇小安","余美美","張醜醜"};
  7.     float score[5][4]={{80,87,68,0},{70,89,88,0},{67,66,50,0},{45,43,68,0},{77,55,79,0}};
  8.     cout<<"座號\t姓名\t\t國文\t英文\t數學\t平均"<<endl;
  9.     cout<<"========================================================="<<endl;
  10.     for(int i=0; i<5; i++)
  11.     {
  12.          cout<<i+1<<"\t"<<name[i]<<"\t\t";
  13.          score[i][3]=(score[i][0]+score[i][1]+score[i][2])/3;
  14.          for(int j=0; j<4; j++)
  15.          {
  16.               cout<<score[i][j]<<"\t";
  17.          }
  18.          cout<<endl;
  19.     }
  20.     system("pause");
  21.     return 0;
  22. }
複製代碼
http://fs-old.mis.kuas.edu.tw/~s1102137106/music/

TOP

返回列表