返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string student[5]={"甲","乙","丙","丁","戊"};
  7.     string subject[5]={"國","英","數","物","化"};
  8.     int array[5][5]={{60,61,62,63,64},
  9.                  {31,32,33,34,35},
  10.                  {61,62,63,64,65},
  11.                  {41,42,43,44,45},
  12.                  {36,37,38,39,49}};
  13.     int j;            
  14.     int i;
  15.     cout << "請問要調出哪一位同學的成績表" << endl;
  16.     cin >> j;
  17.     cout << "請問要調出哪一科的成績" ;
  18.     for(int x = 0; x < 5; x++)
  19.     {
  20.            cout << x + 1 << ":" << subject[x];
  21.     }
  22.     cin >> i;
  23.     cout << "請問你要改幾分" ;
  24.     int z;
  25.     cin >> z;
  26.     array[j-1][i-1]=z;
  27.     for(int c=0;c<5;c++)
  28.         {
  29.                 cout<<"  "<<c+1<<"       "<<student[c]<<"   ";
  30.                 for(int d=0;d<5;d++)
  31.                 {
  32.                     cout<<"  "<<array[c][d]<<"\t";
  33.                 }
  34.          cout<<endl;
  35.          }
  36.    
  37.     system("pause");
  38.     return 0;   
  39. }
複製代碼

TOP

返回列表