4.18

来源:互联网 发布:淘宝开店需要押金吗 编辑:程序博客网 时间:2024/06/05 16:07
#include<iostream>  using namespace std;  int a=1;   class Student    {        int number;           float english;       public:      Student(int n,float e)        {            number=n;            english=e;                  }    void max(Student *p)    {      int m=p->english;      for(int i=0;i<6;i++,p++)      {        if(m<p->english)          a++;          }      }   };   void print()        {          cout<<"英语最高得分学生是"<<a<<"号"<<endl;      }       int main()    {        Student s[6]={Student(1,70),Student(2,36),Student(3,89),Student(4,74),Student(5,77),Student(6,80)};        Student *p;        p=s;      print();            return 0;  }  

0 0