本帖最後由 林少謙 於 2024-7-13 15:02 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int a[5][3]={{43,55,77},
- {76,77,43},
- {78,11,22},
- {43,89,88},
- {98,44,67}};
- string b[]={"Adam","John","Mary","Sharon","Willion"};
- cout<<"座號\t姓名\t\t國文\t英文\t數學"<<endl;
- cout<<"=============================================="<<endl;
- for(int i=0; i<5; i++)
- {
- cout<<i+1<<"\t";
- cout<<b[i]<<"\t\t";
- for(int j=0; j<3; j++)
- {
- cout<<a[i][j]<<"\t";
- }
- cout<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |