- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- { string name[5]={"王一美","王二美","王三美","王四美","王五美"};
- float score[5][4]={{90,90,85,0},{70,75,85,0},{80,95,80,0},{80,85,95,0},{70,95,75,0}};
- cout<<"座號\t姓名\t國文\t英文\t數學\t平均"<<endl;
- cout<<"==========================================="<<endl;
- for(int i=0;i<5;i++)
- {
- cout<<i+1<<"\t";
- cout<<name[i]<<"\t";
- score[i][3]=(score[i][0]+score[i][1]+score[i][2])/3;
- for(int j=0;j<4;j++)
- {
- cout<<score[i][j]<<"\t";
- }
- cout<<endl;
- }
-
- system("pause");
- return 0;
- }
複製代碼 |