91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 9KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-15
  • 語言: C/C++
  • 標簽: 高考錄取??

資源簡介

大學課程設計,實現江蘇高考的錄取機制,有一個文件

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
#include?
#include
using?namespace?std;
class?student
{
public:
char?name[20];
char?sex[20];
int?old;
char?examnum[20];
char?school[100];
int?num1;
int?chinese;
int?num2;
int?math;
int?num3;
int?english;
int?num4;
char?ctest1[20];
int?num5;
char?ctest2[20];
int?TP;?
};
int?cmp_ctest(const?char?a[]const?char?b[])
{
return?a[0] }
struct?Sorter
{
int?num4;
char?ctest1[20];
char?ctest2[20];
Sorter(int?tnum4char?*tctest1char?*tctest2)
{
num4=tnum4;
strcpy(ctest1tctest1);
strcpy(ctest2tctest2);
}
Sorter(int?tnum4const?char?*tctest1const?char?*tctest2)
{
num4=tnum4;
strcpy(ctest1tctest1);
strcpy(ctest2tctest2);
}
int?operator()(const?student?&xconst?student?&y)
{
if?(x.num4!=y.num4)
return?x.num4==num4;
if?(cmp_ctest(x.ctest1ctest1)!=cmp_ctest(y.ctest1ctest1))
return?cmp_ctest(x.ctest1ctest1);
if?(cmp_ctest(x.ctest2ctest2)!=cmp_ctest(y.ctest2ctest2))
return?cmp_ctest(x.ctest2ctest2);
if?(x.TP!=y.TP)
return?x.TP>y.TP;
if?(x.math!=y.math)
return?x.math>y.math;
if(x.chinese!=y.chinese)
return?x.chinese>y.chinese;
if(cmp_ctest(x.ctest1y.ctest1)!=1)
return?cmp_ctest(x.ctest1y.ctest1);
return?cmp_ctest(x.ctest2y.ctest2);
}
};
int?linenum(char?a[])
{
fstream?infile;
infile.open(aios::in);
if(!infile)
{
cout<<“不能打開輸入文件:“<<“data.txt“<<‘\n‘;
return?0;
}
char?str[256];
int?n=0;
while(!infile.eof())
{
infile.getline(str?255);
n++;
}
return?n;
infile.close();
}
void?Read(char?a[]ostream&outfilestudent?student[]int?n)
{
fstream?infile;
infile.open(aios::in);
if(!infile)
{
cout<<“不能打開輸入文件:“< exit(0);
}

for(int?x=0;x {
char?buff[256];
infile.getline(buff256‘‘);
strcpy(student[x].namebuff);
infile.getline(buff256‘‘);
strcpy(student[x].sexbuff);
infile.getline(buff256‘‘);
student[x].old=atol(buff);
infile.getline(buff256‘‘);
strcpy(student[x].examnumbuff);
infile.getline(buff256‘‘);
strcpy(student[x].schoolbuff);
infile.getline(buff256‘‘);
student[x].num1=atol(buff);
infile.getline(buff256‘‘);
student[x].chinese=atol(buff);
infile.getline(buff256‘‘);
student[x].num2=atol(buff);
infile.getline(buff256‘‘);
student[x].math=atol(buff);
infile.getline(buff256‘‘);
student[x].num3=atol(buff);
infile.getline(buff256‘‘);
student[x].english=atol(buff);
infile.getline(buff256‘‘);
student[x].num4=atol(buff);
infile.getline(buff256‘‘);
strcpy(student[x].ctest1buff);
infile.getline(buff256‘‘);
student[x].num5=atol(buff);
infile.getline(buff256);
strcpy(student[x].ctest2buff);
student[x].TP=student[x].chinese+student[x].math+s

評論

共有 條評論

相關資源