1_2.cpp

来自「程序说明C++编的程序 可以作为学生管理系统」· C++ 代码 · 共 52 行

CPP
52
字号
#include<iostream>
#include <fstream>
#include"CBaseStudent.h"
using namespace std;


void fail(CStudent st2[6])

{    
    ofstream outfile2("各科不及格2.txt");
	for (int i=0;i<6;i++)
	 {  
		
		 if(st2[i].Getmaths()<60)    
		 {
			 cout<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的数学不及格"<<endl;
	         outfile2<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的数学不及格"<<endl;
		 }
		     
		 if(st2[i].Getenglish()<60)    
		 {
			 cout<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的英语不及格"<<endl;
	         outfile2<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的英语不及格"<<endl;
		 }
		 
		 if(st2[i].Getphysics()<60)    
		 {	cout<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的物理不及格"<<endl;
            outfile2<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的物理不及格"<<endl;
		 }
		 
		 if(st2[i].Getvc()<60)    
		 {	 cout<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的vc不及格"<<endl;
             outfile2<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的vc不及格"<<endl;
		 }
		 
		 if(st2[i].Getftenet()<60)    
		 {   cout<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的组成原理不及格"<<endl;
             outfile2<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的组成原理不及格"<<endl;
		 }

		 if(st2[i].Getsports()<60)    
		 {	 cout<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的体育不及格"<<endl;
		     outfile2<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的体育不及格"<<endl;
		 }

		 
		 if(st2[i].Getpolitics()<60)    
		 {    cout<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的政治不及格"<<endl;
		      outfile2<<"编号:"<<st2[i].Getnum()<<" "<<st2[i].Getname()<<"的政治不及格"<<endl;
		 }
	}
}      

⌨️ 快捷键说明

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