返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    
  7.     float n[5][4]={{15,17,150,0},{395,413,406,0},
  8.                  {16,85,18,0},{100,17,35,0},{19,21,17,0}};
  9.     string name[5]={"吉井明久","姬路瑞希","島田美波","木下秀吉","土屋康太"};
  10.     cout<<"No.\t  姓名\t        國\t英\t社\t平均"<<endl;
  11.     cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
  12.     int i=0;
  13.     while(i<5)
  14.     {
  15.          n[i][3]=(n[i][0]+n[i][1]+n[i][2])/2;
  16.          cout<<i+1<<"\t";
  17.          cout<<name[i]<<"\t";
  18.          for(int j=0;j<4;j++)
  19.          {
  20.              cout<<n[i][j]<<"\t";            
  21.          }
  22.          i++;
  23.          cout<<"\n";
  24.     }
  25.    
  26.       system("pause");
  27.     return 0;   
  28. }
複製代碼

TOP

返回列表