#include<iostream>
using namespace std;
int main()
{
int i;
int num[10];//num=number
int eng[10];//eng=english
int mat[10];//mat=maths
int phy[10];//phy=physics
int a[10];//a=average
int t[10];//t=total
//int max;//
cout << "Please input number,English score,Maths score,Physics score" << endl;
for (i = 0; i < 10; i++)
{
cin >> num[i] >> eng[i] >> mat[i] >> phy[i];
}
for (i = 0; i<10; i++)
{
t[i] = eng[i] + mat[i] + phy[i];
a[i] = (eng[i] + mat[i] + phy[i]) / 3;
}
cout << "number English Maths Physics Total Average" << endl;
cout << " "<<num[i]<<" "<<eng[i]<<" "<<mat[i]<<" "<< phy[i] << " " << t[i] << " " << a[i] << endl;
return 0;
}
uj5u.com熱心網友回復:
cout << " "<<num[i]<<" "<<eng[i]<<" "<<mat[i]<<" "<< phy[i] << " " << t[i] << " " << a[i] << endl;i越界了。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/67662.html
上一篇:win7 系統多執行緒并發呼叫Dcom遠程組件失敗,回傳“遠程程序呼叫失敗,未能執行。(從 HRESULT 例外: 0x800706BF)
