返回列表 發帖
本帖最後由 林少謙 於 2024-7-13 15:02 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a[5][3]={{43,55,77},
  7.                  {76,77,43},
  8.                  {78,11,22},
  9.                  {43,89,88},
  10.                  {98,44,67}};
  11.     string b[]={"Adam","John","Mary","Sharon","Willion"};
  12.     cout<<"座號\t姓名\t\t國文\t英文\t數學"<<endl;
  13.     cout<<"=============================================="<<endl;
  14.     for(int i=0; i<5; i++)
  15.     {
  16.         cout<<i+1<<"\t";
  17.         cout<<b[i]<<"\t\t";
  18.         for(int j=0; j<3; j++)
  19.         {
  20.             cout<<a[i][j]<<"\t";
  21.         }
  22.         cout<<endl;
  23.     }
  24.     system("pause");
  25.     return 0;
  26. }
複製代碼

TOP

返回列表