返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. cout<<"\t\t\t\t"<<endl;
  7. string name[5][6]={"王大明,李大頭,蘇小安,余美美,張醜醜"};
  8. cout<<"=============================="<<endl;
  9. int score[5][8]={{90,85,85},
  10.                    {70,75,80},
  11.                    {80,95,80},
  12.                    {70,95,75},
  13.                    {80,85,95};

  14. for(int a=0;a<5;a++)
  15. cout<<
  16. system("pause");
  17. return 0;   
  18. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name[5]={"王大明","李大頭","蘇小安","余美美","張醜醜"};
  7.     float score[5][4]={{43,55,77,0},{76,77,43,0},{78,11,22,0},{43,89,88,0},{98,44,67,0}};
  8.     cout<<"座號\t姓名\t\t國文\t英文\t數學\t平均"<<endl;
  9.     cout<<"======================================================="<<endl;
  10.     for(int i=0; i<5; i++)
  11.     {
  12.          score[i][3]=(score[i][0]+score[i][1]+score[i][2])/3;
  13.          cout<<i+1<<"\t"<<name[i]<<"\t\t";
  14.          for(int j=0; j<4; j++)
  15.               cout<<score[i][j]<<"\t";
  16.          cout<<endl;
  17.     }
  18.     system("pause");
  19.     return 0;
  20. }
複製代碼

TOP

返回列表