1 条题解
-
0
#include <iostream> #include <string> using namespace std; struct stu{ string name; int ch; int ma; int en; int t; }; int main() { int n; cin >> n; stu best; cin >> best.name >> best.ch >> best.ma >> best.en; best.t=best.ch+best.ma+best.en; for(int i=1;i<n;i++){ stu s; cin>>s.name>>s.ch>>s.ma>>s.en; s.t=s.ch+s.ma+s.en; if(s.t>best.t) { best=s; } } cout <<best.name<<" "<<best.ch<<" "<<best.ma<<" "<<best.en<<endl; return 0; } // wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow wow
信息
- ID
- 2870
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 2
- 标签
- 递交数
- 176
- 已通过
- 69
- 上传者