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

📄 1_1.cpp

📁 程序说明C++编的程序 可以作为学生管理系统
💻 CPP
字号:
#include<iostream>
#include <fstream>
#include"CBaseStudent.h"
using namespace std;
void gementop(CStudent st1[6])
{    
	ofstream outfile1("各科成绩最高1.txt");
	int max1=0,max2=0,max3=0,max4=0,max5=0,max6=0,max7=0,i;
	 
    for (  i=0;i<6;i++)
	  {	 
          if(st1[i].Getmaths()> st1[max1].Getmaths())
				 max1=i; 
		  if(st1[i].Getenglish() >st1[max2].Getenglish())
				 max2 =i;
		  if(st1[i].Getphysics()> st1[max3].Getphysics())
				 max3 =i; 
		  if(st1[i].Getvc()>st1[max4].Getvc())
				 max4 =i; 
	      if(st1[i].Getftenet()>st1[max5].Getftenet())
				 max5 =i;
		  if(st1[i].Getsports()>st1[max6].Getsports())
				 max6 =i; 
		  if(st1[i].Getpolitics()>st1[max7].Getpolitics() )
				 max7 =i;
	   }
       cout<<"编号:"<<st1[max1].Getnum()<<" "<<st1[max1].Getname()<<"的数学分最高,分数为:"<<st1[max1].Getmaths()<<endl;
	   cout<<"编号:"<<st1[max2].Getnum()<<" "<<st1[max2].Getname()<<"的英语分最高,分数为:"<<st1[max2].Getenglish()<<endl;
	   cout<<"编号:"<<st1[max3].Getnum()<<" "<<st1[max3].Getname()<<"的物理分最高,分数为:"<<st1[max3].Getphysics()<<endl;
	   cout<<"编号:"<<st1[max4].Getnum()<<" "<<st1[max4].Getname()<<"的v  c分最高,分数为:"<<st1[max4].Getvc()<<endl;
	   cout<<"编号:"<<st1[max5].Getnum()<<" "<<st1[max5].Getname()<<"的机组分最高,分数为:"<<st1[max5].Getftenet()<<endl;
	   cout<<"编号:"<<st1[max6].Getnum()<<" "<<st1[max6].Getname()<<"的体育分最高,分数为:"<<st1[max6].Getsports()<<endl;
	   cout<<"编号:"<<st1[max7].Getnum()<<" "<<st1[max7].Getname()<<"的政治分最高,分数为:"<<st1[max7].Getpolitics()<<endl;
	   outfile1<<"编号:"<<st1[max1].Getnum()<<" "<<st1[max1].Getname()<<"的数学分最高,分数为:"<<st1[max1].Getmaths()<<endl;
	   outfile1<<"编号:"<<st1[max2].Getnum()<<" "<<st1[max2].Getname()<<"的英语分最高,分数为:"<<st1[max2].Getenglish()<<endl;
	   outfile1<<"编号:"<<st1[max3].Getnum()<<" "<<st1[max3].Getname()<<"的物理分最高,分数为:"<<st1[max3].Getphysics()<<endl;
	   outfile1<<"编号:"<<st1[max4].Getnum()<<" "<<st1[max4].Getname()<<"的v  c分最高,分数为:"<<st1[max4].Getvc()<<endl;
	   outfile1<<"编号:"<<st1[max5].Getnum()<<" "<<st1[max5].Getname()<<"的机组分最高,分数为:"<<st1[max5].Getftenet()<<endl;
	   outfile1<<"编号:"<<st1[max6].Getnum()<<" "<<st1[max6].Getname()<<"的体育分最高,分数为:"<<st1[max6].Getsports()<<endl;
	   outfile1<<"编号:"<<st1[max7].Getnum()<<" "<<st1[max7].Getname()<<"的政治分最高,分数为:"<<st1[max7].Getpolitics()<<endl;
	   outfile1.close();
	 }

⌨️ 快捷键说明

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