0
已解决
王雨婷
高级守护
高级守护
#include <iostream>
#include <string>
using namespace std;
struct stu{
string name;
long long id,c,m,e,s;
}a[201];
int main()
{
int n;
cin>>n;
for (int i=1;i<=n;i++)
{
cin>>a[i].name>>a[i].id>>a[i].c>>a[i].m>>a[i].e>>a[i].s;
}
for (int i=1;i<=n;i++)
{
if (a[i].id%2==1)
{
cout<<a[i].name<<" "<<a[i].c<<" "<<a[i].m<<" "<<a[i].e<<" "<<a[i].s;
}
cout<<endl;
}
return 0;
}
麻烦看一下哪错了?
1
0
0
姜思远
初级光能
初级光能
核心:
for循环 (int i=1;i<=n;i++)
{
如果 (a[i].id%2==1)
{
cout<<a[i].name<<" "<<a[i].c<<" "<<a[i].m<<" "<<a[i].e<<" "<<a[i].s;
cout<<endl;
}
}
0
0