|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #include<iostream>
- #include<string>
- using namespace std;
- class Student
- {
- private:
- string number,name;
- int score;
- public:
- Student(string a,string b,int c)
- {
- number=a;
- name=b;
- score=c;
- }
- void display()
- {
- cout<<number<<' '<<name<<' '<<score<<endl;
- }
- friend void judge(Student &t);
- int sco()
- {
- return score;
- }
- }stu[1000000];
- void judge(Student t[],int n)
- {
- for(int i=0;i<n;i++)
- if(t[0].sco()<t[i].sco())t[0]=t[i];
- t[0].display();
- }
- int main()
- {
- int n,i;
- string number,name;
- int score;
- while(1)
- {
- cin>>n;
- if(n==0)break;
- for(i=0;i<n;i++)
- cin>>stu[i].number>>stu[i].name>>stu[i].score;
- judge(stu,n);
- }
- reutrn 0;
- }
复制代码 大家帮我看看 好像错误很多 求大神帮忙改改
是找学生的最低成绩
|
|