#include "bits/stdc++.h"
#define N 110
using namespace std;
struct student{
string name;
signed int sno;
signed int Chinese, Maths;
}stu[N];
int main(){
signed int n, m;
cin >> n >> m;
for(signed int i = 0;i < n;i ++){
cin >> stu[i].name >> stu[i].sno >> stu[i].Chinese >> stu[i].Maths;
}
for(signed int i = 0;i < m;i ++){
string cmd;
cin >> cmd;
if(cmd == "name"){
string na;
cin >> na;
for(signed int j = 0;j < n;j ++){
if(stu[j].name == na){
cout << stu[j].Chinese << ' ' << stu[j].Maths << endl;
}
}
}if(cmd == "number"){
signed int y;
cin >> y;
for(signed int j = 0;i < n;j ++){
if(stu[j].sno == y){
double sum = 0.0;
sum = stu[j].Chinese + stu[j].Maths;
cout << fixed << setprecision(2) << sum / 2.0 << endl;
}
}
}
}
return 0;
}
这个程序运行后报“运行时错误”,代码139
该如何处理呀
谢谢