- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- float a[5][4]={{90,85,85,(90.0+85.0+85.0)/3},
- {76,77,43,(76.0+77.0+43.0)/3},
- {78,11,22,(78.0+11.0+22.0)/3},
- {43,89,88,(43.0+89.0+88.0)/3},
- {98,44,67,(98.0+44.0+67.0)/3}};
- string b[5]={"Adam","John","Mary","Sharon","Willion"};
- cout<<"座號\t姓名\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<4; j++)
- {
- cout<<a[i][j]<<"\t";
- }
- cout<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |