# include<iostream>
# include<string>
# include<algorithm>
# include<stdio.h>
# include<vector>
using namespace std;
struct student
{
int hao,h,w;
string name;
}stu;
bool LessSort(student a,student b) { return (a.hao<b.hao); }
int main()
{
int n,xh,xm,he,we;
cin>>n;
vector<student> v;
for(int i=;i<n;i++)
{
cin>>stu.hao>>stu.name>>stu.h>>stu.w;
v.push_back(stu);
}
sort(v.begin(),v.end(),LessSort);
int count=,maxh,maxw,flag=;
string maxname;
for(int i=;i<n;i=i+)
{
if(i==)
{
maxh = v[i].h;
maxname = v[i].name;
maxw = v[i].w;
}
else
{
if(v[i].hao==v[i-].hao)
{
if(v[i].h>v[i-].h)
{
maxh = v[i].h;
maxname = v[i].name;
maxw = v[i].w;
}
}
else
{
printf("%06d ",v[i-].hao);
cout<<maxname<<" "<<maxh<<" "<<maxw<<endl;
maxh = v[i].h;
maxname = v[i].name;
maxw = v[i].w;
if(i==n-)
{
printf("%06d ",v[i-].hao);
cout<<maxname<<" "<<maxh<<" "<<maxw<<endl;
}
}
}
}
return ;
}
#include<iostream>
using namespace std;
class Student
{
public:
Student()
{
number=;
name;
mark=;
}
void set_student();
void show_student();
friend void find(Student stu[],int q);
private:
int number;
char name[];
int mark;
};
void Student::set_student()
{
cin>>number;
cin>>name;
cin>>mark;
}
void Student::show_student()
{
cout<<number<<' '<<name<<' '<<mark<<endl;
}
void find(Student stu[],int q)
{
int min=,w;
for(int i=;i<q;i++)
{
if(stu[i].mark<min)
{
w=i;
min=stu[i].mark;
}
}
stu[w].show_student();
}
int main()
{
int n;
Student stu[];
while(cin>>n)
{
if(n==)break;
for(int i=;i<n;i++)
{
stu[i].set_student();
}
find(stu,n);
}
return ;
}

最新文章

  1. python之路二十一
  2. [经验] Win7减肥攻略(删文件不删功能、简化优化系统不简优化性能)
  3. Git服务器搭建及配置
  4. C#5.0 特性
  5. poj 3841 Double Queue (AVL树入门)
  6. 在树莓派上使用ss和iptables实现fq功能
  7. 使用ttXactAdmin、ttSQLCmdCacheInfo、ttSQLCmdQueryPlan获取SQL相关具体信息[TimesTen运维]
  8. DOM遍历 - 后代
  9. Java 三大特性
  10. IO代码记忆
  11. 【.NETCore开源】开弓没有回头箭
  12. mpvue——引入vant_weapp组件
  13. MVC 使用缓存
  14. 我的django2
  15. #WEB安全基础 : HTML/CSS | 0x1初识CSS
  16. python----函数的动态传参
  17. servlet 请求乱码解决
  18. 用prop还是attr
  19. Highcharts.Chart
  20. Java从入门到精通全套教程免费分享

热门文章

  1. maven settings 设置
  2. For macOS.百度网盘 破解SVIP、下载速度限制~
  3. 基于socketserver模块实现并发的套接字(tcp、udp)
  4. mysql更新返回值问题(更新内容跟之前内容一样,返回0)
  5. php 电商系统SKU库存设计
  6. hive 学习系列四(用户自定义函数)
  7. Linux 系统无法登录?你的程序有问题吧!
  8. u-boot、kernel、root系统烧写和挂载命令命令
  9. THINKPHP网站漏洞怎么修复解决
  10. mtools使用-1