- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
-
- float n[5][4]={{15,17,150,0},{395,413,406,0},
- {16,85,18,0},{100,17,35,0},{19,21,17,0}};
- string name[5]={"吉井明久","姬路瑞希","島田美波","木下秀吉","土屋康太"};
- cout<<"No.\t 姓名\t 國\t英\t社\t平均"<<endl;
- cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
- int i=0;
- while(i<5)
- {
- n[i][3]=(n[i][0]+n[i][1]+n[i][2])/2;
- cout<<i+1<<"\t";
- cout<<name[i]<<"\t";
- for(int j=0;j<4;j++)
- {
- cout<<n[i][j]<<"\t";
- }
- i++;
- cout<<"\n";
- }
-
- system("pause");
- return 0;
- }
複製代碼 |