返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {



  6.     float a[5][4]={{90,85,85,(90+85+85)/3},
  7.                    {70,75,80,(70+75+80)/3},
  8.                    {80,95,80,(80+95+80)/3},
  9.                    {70,95,75,(70+95+75)/3},
  10.                    {80,85,95,(80+85+95)/3}};

  11.     string b[5]={"王大明","李大頭","蘇小安","余美美","張醜醜"};
  12.     cout<<"座號\t姓名\t國文\t英文\t數學\t平均"<<endl;
  13.     cout<<"=============================================================="<<endl;

  14.     for(int i=0;i<=4;i++){
  15.             cout<<i+1<<"\t";
  16.             cout<<b[i]<<"\t";

  17.         for(int j=0;j<=3;j++){

  18.             cout<<a[i][j]<<"\t";
  19.         }
  20.         cout<<endl;

  21.     }




  22.     system("pause");
  23.     return 0;
  24. }
複製代碼

TOP

返回列表