⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 duixiangshuzu.cpp

📁 对c++中一些摸板及派生应用的举例
💻 CPP
字号:
#include<iostream>
using namespace std;

class Student
{
public:
	Student(int,float);
	void max(Student *);
private:
	int id;
	float score;
};
Student::Student(int a,float b)
{
	id=a;
	score=b;
}
void Student::max(Student *s)
{
  int n=0;int max=s[0].score;
	for(int i=0;i<3;i++)
    	{if(s[i].score>max)
        	max=s[i].score;
             n=i;}
 cout<<max;
cout<<n;
}
void main()
{
	Student stud[3]=
	{Student(1,34),
	 Student(2,97),
	 Student(3,66)
	};
	 Student *p=stud;
	 p[2].max(stud);

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -