返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {   string name[5]={"王一美","王二美","王三美","王四美","王五美"};
  6.     float score[5][4]={{90,90,85,0},{70,75,85,0},{80,95,80,0},{80,85,95,0},{70,95,75,0}};
  7.     cout<<"座號\t姓名\t國文\t英文\t數學\t平均"<<endl;
  8.      cout<<"==========================================="<<endl;
  9.      for(int i=0;i<5;i++)
  10.      {
  11.      cout<<i+1<<"\t";
  12.      cout<<name[i]<<"\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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  21.     system("pause");
  22.     return 0;
  23. }  
複製代碼

TOP

返回列表