- 学生信息记录
- @ 2026-07-17 19:16:25
#include<bits/stdc++.h>
using namespace std;
int n,zf[1005],id[1005],yw[1005],sx[1005],ey[1005],wu[1005],hu[1005],bjg;
struct student
{
int id;
string na;
int ch,ma,en,wl,hx;
};
string name[1005];
int main( )
{
cin>>n;
for (int i=1;i<=n;i++)
{
student st;
cin>>st.id>>st.na>>st.ch>>st.ma>>st.en>>st.wl>>st.hx;
id[i]=st.id;
name[i]=st.na;
yw[i]=st.ch;
sx[i]=st.ma;
ey[i]=st.en;
wu[i]=st.wl;
hu[i]=st.hx;
zf[i]=st.ch+st.ma+st.en+st.wl+st.hx;
if (yw[i]<60 || sx[i]<60 || ey[i]<60 || wu[i]<60 || hu[i]<60)
bjg++;
}
cout<<bjg<<endl;
sort(zf+1,zf+1+n,);
for (int i=1;i<=n;i++)
cout<<id[i]<<' '<<name[i]<<" "<<yw[i]<<' '<<sx[i]<<" "<<ey[i]<<' '<<wu[i]<<" "<<hu[i]<<' '<<zf[i]<<endl;
return 0;
}
2 条评论
-
202607zj05高山 (高山) LV 7 @ 2026-07-18 17:50:09
我去,结构体你都会了
-
@ 2026-07-17 19:16:41
求大佬修改指正
- 1
信息
- ID
- 1005
- 难度
- 5
- 分类
- (无)
- 标签
- 递交数
- 204
- 已通过
- 65
- 通过率
- 32%
- 被复制
- 11
- 上传者