谁拿了最多的奖学金文档格式.docx

上传人:b****0 文档编号:13447153 上传时间:2022-10-10 格式:DOCX 页数:29 大小:25.21KB
下载 相关 举报
谁拿了最多的奖学金文档格式.docx_第1页
第1页 / 共29页
谁拿了最多的奖学金文档格式.docx_第2页
第2页 / 共29页
谁拿了最多的奖学金文档格式.docx_第3页
第3页 / 共29页
谁拿了最多的奖学金文档格式.docx_第4页
第4页 / 共29页
谁拿了最多的奖学金文档格式.docx_第5页
第5页 / 共29页
点击查看更多>>
下载资源
资源描述

谁拿了最多的奖学金文档格式.docx

《谁拿了最多的奖学金文档格式.docx》由会员分享,可在线阅读,更多相关《谁拿了最多的奖学金文档格式.docx(29页珍藏版)》请在冰豆网上搜索。

谁拿了最多的奖学金文档格式.docx

第三行是这N个学生获得的奖学金的总数。

SampleInput

4

YaoLin8782YN0

ChenRuiyi8878NY1

LiXin9288NN0

ZhangQin8387YN1

SampleOutput

ChenRuiyi

900028700

ProblemSource

NOI2005

来源:

最新评论

您尚未登陆本站,不能发表评论,请

评论人:

boynanboy发布时间:

2011-3-80:

13:

47

写的不太好,但是还正确,大家看看吧〜

#include<

iostream>

string>

usingnamespacestd;

classstudent

{

private:

stringname;

floatexam;

floatclas;

charcadre;

charwest;

intnum;

inttotal;

public:

student(){total=O;

}

intcount();

voiddate();

stringprint();

};

voidstudent:

:

date()

cin>

>

name>

exam»

clas>

cadre>

west»

num;

stringstudent:

print()

returnname;

intstudent:

count()

if(exam>

80&

&

num>

0)total+=8000;

85&

80)total+=4000;

90)total+=2000;

west=='

Y'

)total+=1000;

if(clas>

cadre=='

)total+=850;

returntotal;

intmain()

intm=0,a[10],max=0,turn,tol=0;

student*p[10];

coutvv"

请输入学生数量:

"

vvendl;

m;

for(inti=0;

i<

i++)

coutvv"

请输入第"

vvi+1vv"

个学生信息:

p[i]=newstudent;

(*p[i]).date();

a[i]=(*p[i]).count();

tol+=a[i];

if(a[i]>

max)

max=a[i];

turn=i;

stringnam=(*p[turn]).print();

vvtolvvendl;

得奖金最多的是:

vvnamvv"

金额是:

vvmaxvvendlvv"

总金额是:

return0;

评论人:

zhanglinjie发布时间:

2010-7-2014:

15:

26

#includeviostream>

#includevstring>

typedefstructnode

intmax;

intlastscore;

intclassscore;

charmanage;

intpaper;

}*scholarship;

intsearch_max(scholarshipp)

if(p->

lastscore>

p->

paper>

=1)p->

max+=8000;

classscore>

85)p->

max+=4000;

=90)p->

max+=2000;

max+=1000;

manage=='

80)p->

max+=850;

returnp->

max;

intN;

N;

scholarshiphead=newnode[N];

for(inti=0;

head[i].max=0;

head[i].name>

head[i].lastscore>

head[i].classscore>

head[i].manage>

head[i].we

st>

head[i].paper;

intindex=0,max=0;

if(search_max(&

head[i])>

head[index].max)

index=i;

max+=head[i].max;

}cout<

vhead[index].namevvendlvvhead[index].max<

vendl

vvmaxvvendl;

delete[]head;

sjb2发布时间:

2010-5-711:

59:

36

classCStudent

stringName;

//姓名;

长度不超过20,不含空格,字母组成

intScore;

//期末平均成绩;

[0,100]

intComment;

//班级评议成绩;

charIsCadre;

//是否学生干部;

{Y,N}

charIsWest;

//是否西部;

intThesisNum;

//论文数目;

[0,10]

voidmain()

intStuNum=0;

请输入学生数:

;

cin»

StuNum;

CStudent*pStu=newCStudent[StuNum];

下面开始输入学生信息,格式为:

lazycat8782YN0"

vvendlvvendl;

for(inti=0;

ivStuNum;

i++)

<

i+1<

个学生信息:

pStu[i].Name>

pStu[i].Score>

pStu[i].Comment»

pStu[i].lsCadre>

pStu[i].lsWes

pStu[i].ThesisNum;

intmax=0;

//最多的奖学金

intindex=0;

intsum=0;

//所有学生获得的奖学金总数

for(intj=0;

j<

StuNum;

j++)

inttotal=0;

//获得奖学金总数

//院士奖学金

if(pStu[j].Score>

80&

pStu[j].ThesisNum>

=1)

sum+=8000;

total+=8000;

//五四奖学金

85&

pStu[j].Comment>

80)

sum+=4000;

total+=4000;

//成绩优秀奖

90)

sum+=2000;

total+=2000;

//西部奖学金

pStu[j].lsWest=='

sum+=1000;

total+=1000;

//班级贡献奖

pStu[j].lsCadre=='

sum+=850;

total+=850;

if(total>

max)

max=total;

index=j;

coutvvendlvvendl;

coutvvpStu[index].Namev<

endlvvmaxvvendlvvsumvvendl;

delete[]pStu;

fhqtmso发布时间:

2009-8-617:

26:

32

//student.h

#ifndefSTUDENT

#defineSTUDENT

#includeviostream>

#includeviterator>

#includevstring>

#include<

vector>

set>

cctype>

structstudent

student():

aversco(0),score(0),

cadre('

N'

),west('

),paper(O),prize(O){}

/*friendbooloperator<

(conststudent&

conststudent&

);

*/

intaversco;

intscore;

intprize;

/*friendostream&

operator<

(ostream&

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > IT计算机

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1