518 条题解
-
0
zhangha26 LV 4 @ 2013-02-27 09:43:20
P1001题解
试题
描述
某校的惯例是在每学期的期末考试之后发放奖学金。发放的奖学金共有五种,获取的条件各自不同:
1) 院士奖学金,每人8000元,期末平均成绩高于80分(>80),并且在本学期内发表1篇或1篇以上论文的学生均可获得;
2) 五四奖学金,每人4000元,期末平均成绩高于85分(>85),并且班级评议成绩高于80分(>80)的学生均可获得;
3) 成绩优秀奖,每人2000元,期末平均成绩高于90分(>90)的学生均可获得;
4) 西部奖学金,每人1000元,期末平均成绩高于85分(>85)的西部省份学生均可获得;
5) 班级贡献奖,每人850元,班级评议成绩高于80分(>80)的学生干部均可获得;
只要符合条件就可以得奖,每项奖学金的获奖人数没有限制,每名学生也可以同时获得多项奖学金。例如姚林的期末平均成绩是87分,班级评议成绩82分,同时他还是一位学生干部,那么他可以同时获得五四奖学金和班级贡献奖,奖金总数是4850元。
现在给出若干学生的相关数据,请计算哪些同学获得的奖金总数最高(假设总有同学能满足获得奖学金的条件)。
格式
输入格式
输入的第一行是一个整数N(1 <= N <= 100),表示学生的总数。接下来的N行每行是一位学生的数据,从左向右依次是姓名,期末平均成绩,班级评议成绩,是否是学生干部,是否是西部省份学生,以及发表的论文数。姓名是由大小写英文字母组成的长度不超过20的字符串(不含空格);期末平均成绩和班级评议成绩都是0到100之间的整数(包括0和100);是否是学生干部和是否是西部省份学生分别用一个字符表示,Y表示是,N表示不是;发表的论文数是0到10的整数(包括0和10)。每两个相邻数据项之间用一个空格分隔。
输出格式
输出包括三行,第一行是获得最多奖金的学生的姓名,第二行是这名学生获得的奖金总数。如果有两位或两位以上的学生获得的奖金最多,输出他们之中在输入文件中出现最早的学生的姓名。第三行是这N个学生获得的奖学金的总数。
样例
样例输入
4
YaoLin 87 82 Y N 0
ChenRuiyi 88 78 N Y 1
LiXin 92 88 N N 0
ZhangQin 83 87 Y N 1
样例输出
ChenRuiyi
9000
28700
限制
1s
题解
分析
本题从题意分析是一道模拟题,从数据分析是一道小数据题。
本题是一道条件复杂、做法简单的模拟题。
因此本题主要考察选手的基本编程能力。
本题做法较简单,可以直接简单模拟。
具体做法
1、数据初始化;
2、循环3-6的操作直到处理完所有数据;
3、输入一组数据;
4、根据条件计算奖金值;
5、累加奖金值;
6、与最大值比较,并按情况覆盖;
7、输出结果;
代码
#include<iostream>
#include<string>
using namespace std;
int main()
{
//数据初始化
int maxjj=-1,sumjj=0,jj=0,n;
string maxjjn,jjn;
int qmpjcj,bjpycj,fblws;
char xsgb,xbsfxs;
cin>>n;
//循环操作直到处理完所有数据
for(int i=0;i<n;i++,jj=0)
{
//输入一组数据
cin>>jjn>>qmpjcj>>bjpycj>>xsgb>>xbsfxs>>fblws;
//根据条件计算奖金值
if(qmpjcj>80&&fblws>0)
jj+=8000;
if(qmpjcj>85&&bjpycj>80)
jj+=4000;
if(qmpjcj>90)
jj+=2000;
if(qmpjcj>85&&xbsfxs=='Y')
jj+=1000;
if(bjpycj>80&&xsgb=='Y')
jj+=850;
//累加奖金值
sumjj+=jj;
//与最大值比较,并按情况覆盖
if(jj>maxjj)
maxjj=jj,maxjjn=jjn;
}
//输出结果
cout<<maxjjn<<endl<<maxjj<<endl<<sumjj<<endl;
return 0;
谢谢观看,欢迎提出意见。 -
0@ 2013-02-22 20:36:36
###描述
某校的惯例是在每学期的期末考试之后发放奖学金。发放的奖学金共有五种,获取的条件各自不同:
1) 院士奖学金,每人8000元,期末平均成绩高于80分(>80),并且在本学期内发表1篇或1篇以上论文的学生均可获得;
2) 五四奖学金,每人4000元,期末平均成绩高于85分(>85),并且班级评议成绩高于80分(>80)的学生均可获得;
3) 成绩优秀奖,每人2000元,期末平均成绩高于90分(>90)的学生均可获得;
4) 西部奖学金,每人1000元,期末平均成绩高于85分(>85)的西部省份学生均可获得;
5) 班级贡献奖,每人850元,班级评议成绩高于80分(>80)的学生干部均可获得;
只要符合条件就可以得奖,每项奖学金的获奖人数没有限制,每名学生也可以同时获得多项奖学金。例如姚林的期末平均成绩是87分,班级评议成绩82分,同时他还是一位学生干部,那么他可以同时获得五四奖学金和班级贡献奖,奖金总数是4850元。
现在给出若干学生的相关数据,请计算哪些同学获得的奖金总数最高(假设总有同学能满足获得奖学金的条件)。
###格式
输入格式
输入的第一行是一个整数N(1 <= N <= 100),表示学生的总数。接下来的N行每行是一位学生的数据,从左向右依次是姓名,期末平均成绩,班级评议成绩,是否是学生干部,是否是西部省份学生,以及发表的论文数。姓名是由大小写英文字母组成的长度不超过20的字符串(不含空格);期末平均成绩和班级评议成绩都是0到100之间的整数(包括0和100);是否是学生干部和是否是西部省份学生分别用一个字符表示,Y表示是,N表示不是;发表的论文数是0到10的整数(包括0和10)。每两个相邻数据项之间用一个空格分隔。
输出格式
输出包括三行,第一行是获得最多奖金的学生的姓名,第二行是这名学生获得的奖金总数。如果有两位或两位以上的学生获得的奖金最多,输出他们之中在输入文件中出现最早的学生的姓名。第三行是这N个学生获得的奖学金的总数。
###样例
样例输入
4
YaoLin 87 82 Y N 0
ChenRuiyi 88 78 N Y 1
LiXin 92 88 N N 0
ZhangQin 83 87 Y N 1
样例输出
ChenRuiyi
9000
28700
###限制
1s###题解
本题从题意分析是一道模拟题,从数据分析是一道小数据题。
本题是一道条件复杂、做法简单的模拟题。
因此本题主要考察选手的基本编程能力。
本题做法较简单,可以直接简单模拟。具体做法:
1、将最大值,累加和初始化,并输入数据组数;
2、循环3-6的操作直到处理完所有数据;
3、输入一组数据;
4、根据条件计算奖金值;
5、与最大值比较,并按情况覆盖;
6、累加奖金值;
7、输出结果;代码
#include<iostream>
#include<string>
using namespace std;int main()
{
int maxjj=-1,sumjj=0,jj,n;
string maxjjn,jjn;
int qmpjcj,bjpycj,fblws;
char xsgb,xbsfxs;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>jjn>>qmpjcj>>bjpycj>>xsgb>>xbsfxs>>fblws;
jj=0;
if(qmpjcj>80&&fblws>0)
jj+=8000;
if(qmpjcj>85&&bjpycj>80)
jj+=4000;
if(qmpjcj>90)
jj+=2000;
if(qmpjcj>85&&xbsfxs=='Y')
jj+=1000;
if(bjpycj>80&&xsgb=='Y')
jj+=850;
sumjj+=jj;
if(jj>maxjj)
maxjj=jj,maxjjn=jjn;
}
cout<<maxjjn<<endl<<maxjj<<endl<<sumjj<<endl;
return 0;
}###谢谢观看,欢迎提出意见。
-
0@ 2013-01-31 20:53:51
-
0@ 2009-11-15 22:04:09
郁闷啊为什么全错啊在pascal运行得好好的啊、、、、
program p1001;
var a:array[1..6,1..10] of string;
b,c,d,e:array[1..100] of integer;
i,j,n,m,p,z,re:integer;
begin
readln(n);
for i:=1 to n do
for j:=1 to 6 do
read(a[j,i]);
for i:=1 to n do
begin
val(a[2,i],b[i],re);
val(a[3,i],c[i],re);
val(a[6,i],d[i],re);
end;
for i:=1 to n do
e[i]:=0;
for i:=1 to n do
begin
if (b[i]>80) and (d[i]=1) then
e[i]:=e[i]+8000;
if (b[i]>85) and (c[i]>80) then
e[i]:=e[i]+4000;
if (b[i]>90) then e[i]:=e[i]+2000;
if (b[i]>85) and (a[5,i]='Y') then
e[i]:=e[i]+1000;
if (c[i]>80) and (a[4,i]='Y') then
e[i]:=e[i]+850;
end;
m:=0;z:=0;
for i:=1 to n do
if e[i]>m then m:=e[i];
for i:=1 to n do
if m=e[i] then p:=i;
for i:=1 to n do
z:=z+e[i];
writeln(a[1,p]);
writeln(e[p]);
write(z);
end. -
0@ 2009-11-11 20:40:27
通过 10546人
提交 30000次 -
0@ 2009-04-08 09:12:58
太过分了!!!!!!!!!!!
-
0@ 2009-04-06 18:31:33
var
n,i,zong,max:longint;
f:char;
name:array[1..100] of string;
qi:array[1..100] of longint;
ban:array[1..100] of longint;
gan:array[1..100] of char;
xi:array[1..100] of char;
lun:array[1..100] of longint;
all:array[1..100] of longint;
begin
readln(n);
for i:=1 to n do
begin
repeat
read(f);
name[i]:=name[i]+f
until f=' ';
read(qi[i],ban[i]);
read(f);read(gan[i]);read(f);read(xi[i]);readln(lun[i]);
end;{for}
for i:=1 to n do
begin
if (qi[i]>80)and(lun[i]>=1) then all[i]:=all[i]+8000;
if (qi[i]>85)and(ban[i]>80) then all[i]:=all[i]+4000;
if qi[i]>90 then all[i]:=all[i]+2000;
if (xi[i]='Y')and(qi[i]>85) then all[i]:=all[i]+1000;
if (gan[i]='Y')and(ban[i]>80) then all[i]:=all[i]+850;
end;{for}
max:=all[1];
for i:=1 to n do
begin
if all[i]>max then max:=all[i];
zong:=zong+all[i];
end;{for}
for i:=1 to n do
if all[i]=max then
begin
writeln(name[i]);
writeln(all[i]);
writeln(zong);
exit;
end; -
0@ 2009-04-01 20:59:39
#include
#include
using namespace std;
main()
{
int n,money=0,max=0,b,c,d,sum=0,i,j;
char a[21],x,y,z[21];
cin>>n;
for(i=1;i>b>>c>>x>>y>>d;
if(b>80&&d>0)
money+=8000;
if(b>85&&c>80)
money+=4000;
if(b>90)
money+=2000;
if(b>85&&y=='Y')
money+=1000;
if(c>80&&x=='Y')
money+=850;
if(money>max)
{max=money;
strcpy(z,a);}
sum+=money;
money=0;}
printf("%s",z);
cout -
0@ 2009-04-01 18:03:00
帮我看看
type stu=record
name:0..20;
qiji:0..100;
banji:0..100;
xuegan:char;
xigan:char;
lunwen:0..10;
end;
var a:array[1..100]of stu; b:array[1..100]of integer;
i,N,j,k,d:integer;
c:stu;
begin
readln(N);
for i:=1 to N do begin
readln(a[i].name); read(a[i].qiji,a[i].banji,a[i].xuegan,a[i].xigan,a[i].lunwen);
end;
for i:=1 to N do begin
if (a[i].qiji>80) and (a[i].lunwen>=1) then b[i]:=b[i]+8000;
if (a[i].qiji>85) and (a[i].banji>80) then b[i]:=b[i]+4000;
if (a[i].qiji>90) then b[i]:=b[i]+2000;
if (a[i].qiji>85) and (a[i].xigan='y') then b[i]:=b[i]+1000;
if (a[i].banji>80) and (a[i].xuegan='y') then b[i]:=b[i]+850;
end;
for i:=1 to N-1 do
for j:=N downto i+1 do begin
if b[j-1] -
0@ 2009-03-31 17:56:55
钱的总数一定要用长整型;
var
n,i,zong,max:longint;
f:char;
name:array[1..100] of string;
qi:array[1..100] of longint;
ban:array[1..100] of longint;
gan:array[1..100] of char;
xi:array[1..100] of char;
lun:array[1..100] of longint;
all:array[1..100] of longint;
begin
readln(n);
for i:=1 to n do
begin
repeat
read(f);
name[i]:=name[i]+f
until f=' ';
read(qi[i],ban[i]);
read(f);read(gan[i]);read(f);read(xi[i]);readln(lun[i]);
end;{for}
for i:=1 to n do
begin
if (qi[i]>80)and(lun[i]>=1) then all[i]:=all[i]+8000;
if (qi[i]>85)and(ban[i]>80) then all[i]:=all[i]+4000;
if qi[i]>90 then all[i]:=all[i]+2000;
if (xi[i]='Y')and(qi[i]>85) then all[i]:=all[i]+1000;
if (gan[i]='Y')and(ban[i]>80) then all[i]:=all[i]+850;
end;{for}
max:=all[1];
for i:=1 to n do
begin
if all[i]>max then max:=all[i];
zong:=zong+all[i];
end;{for}
for i:=1 to n do
if all[i]=max then
begin
writeln(name[i]);
writeln(all[i]);
writeln(zong);
exit;
end;end.
-
0@ 2009-03-30 18:26:25
帮忙看看!!!!!
帮忙看看!!!!!
帮忙看看!!!!!
帮忙看看!!!!!
帮忙看看!!!!!
帮忙看看!!!!!
帮忙看看!!!!!编译通过...
├ 测试数据 01:运行时错误...| 错误号: 106 | 无效数字格式
├ 测试数据 02:运行时错误...| 错误号: 106 | 无效数字格式
├ 测试数据 03:运行时错误...| 错误号: 106 | 无效数字格式
├ 测试数据 04:运行时错误...| 错误号: 106 | 无效数字格式
├ 测试数据 05:运行时错误...| 错误号: 106 | 无效数字格式
├ 测试数据 06:运行时错误...| 错误号: 106 | 无效数字格式
├ 测试数据 07:运行时错误...| 错误号: 106 | 无效数字格式
├ 测试数据 08:运行时错误...| 错误号: 106 | 无效数字格式
├ 测试数据 09:运行时错误...| 错误号: 106 | 无效数字格式
├ 测试数据 10:运行时错误...| 错误号: 106 | 无效数字格式
---|---|---|---|---|---|---|---|-
Unaccepted 有效得分:0 有效耗时:0msvar name:array[1..100] of string;
money:array[1..100] of longint;
i,j,k,l,n,p,b,z:integer;
g,x:char;
s:string;
begin
readln(n); k:=0;
for i:=1 to n do
begin
readln(name[i],p,b,g,x,l);
if (p>80)and(l>1) then money[i]:=money[i]+8000;
if (p>85)and(b>80) then money[i]:=money[i]+4000;
if p>90 then money[i]:=money[i]+2000;
if (p>85)and(x='Y') then money[i]:=money[i]+1000;
if (b>80)and(g='Y') then money[i]:=money[i]+850;
k:=k+money[i];
end;
for i:=1 to n-1 do
begin
if money[i] -
0@ 2009-03-29 16:32:25
program p1001;
var
name:array[1..100]of string;
s,a,b,e:array[1..100]of longint;
c,d:array[1..100]of char;
n,i,res,k:longint;
ch,ch1,ch2:char;
function jisuan(a,b:longint; c,d:char; e:longint):longint;
begin
jisuan:=0;
if (a>80)and(e>=1) then jisuan:=jisuan+8000;
if (a>85)and(b>80) then jisuan:=jisuan+4000;
if a>90 then jisuan:=jisuan+2000;
if (a>85)and(d='Y') then jisuan:=jisuan+1000;
if (b>80)and(c='Y') then jisuan:=jisuan+850;
end;
procedure init;
begin
readln(n);
res:=0;
end;
procedure doit;
begin
for i:=1 to n do
begin
read(ch);
name[i]:=ch;
read(ch);
while ch' ' do
begin
name[i]:=name[i]+ch;
read(ch);
end;
read(a[i],b[i],ch1,c[i],ch2,d[i],e[i]);
s[i]:=jisuan(a[i],b[i],c[i],d[i],e[i]);
res:=res+s[i];
end;
k:=1;
for i:=1 to n do
if s[i]>s[k] then k:=i;
end;
procedure outit;
begin
writeln(name[k]);
writeln(s[k]);
writeln(res);
end;
begin
init;
doit;
outit;
end.细节题...很容易浪费时间!!
-
0@ 2009-03-28 10:32:33
#include "stdio.h"
#include "malloc.h"typedef struct
{ char name[20];
int score[2];
char gb;
char xb;
int lw;
}DATA;int main()
{int * K;
int N;
DATA * M;
int i,flag=0;
int sum=0,max=0;scanf("%d",&N);
M=(DATA*)malloc(sizeof(DATA)*N);
K=(int*)malloc(sizeof(int)*N);for(i=0;i80))
K[i]+=4000;
}for(i=0 ; i < N ; i++)//成绩优秀奖
{
if(M[i].score[0] >90)K[i]+=2000;
}for(i=0 ; i < N ; i++) //西部奖学金
{
if(M[i].score[0] >85 && M[i].xb =='Y')K[i]+= 1000;
}for(i = 0; i < N; i++) //班级贡献奖
{
if(M[i].score[1] >80 && M[i].gb == 'Y')K[i]+= 850;
}max=K[0];
for(i=1 ;i -
0@ 2009-03-28 07:05:37
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
var
n,i,j,ok,max,mx,jj:longint;
st:string;
name:array[1..100] of string;
ganbu,xibu,lunwen:array[1..100] of boolean;
a,b,money:array[1..100] of integer;
begin
fillchar(ganbu,sizeof(ganbu),false);
fillchar(xibu,sizeof(xibu),false);
fillchar(lunwen,sizeof(lunwen),false);
fillchar(money,sizeof(money),0);
fillchar(a,sizeof(a),0);
fillchar(b,sizeof(b),0);
max:=-10000; st:='';
readln(n);
for i:=1 to n do
begin
readln(st);
j:=pos(' ',st);
name[i]:=copy(st,1,j-1);
st:=copy(st,j+1,50);
j:=pos(' ',st);
val(copy(st,1,j-1),a[i]);
st:=copy(st,j+1,50);
j:=pos(' ',st);
val(copy(st,1,j-1),b[i]);
st:=copy(st,j+1,50);
if st[1]='Y' then ganbu[i]:=true;
if st[3]='Y' then xibu[i]:=true;
val(st[5],ok); if ok>0 then lunwen[i]:=true;
if (a[i]>80)and(lunwen[i]) then money[i]:=money[i]+8000;
if (a[i]>85)and(b[i]>80) then money[i]:=money[i]+4000;
if (a[i]>90) then money[i]:=money[i]+2000;
if (a[i]>85)and(xibu[i]) then money[i]:=money[i]+1000;
if (b[i]>80)and(ganbu[i]) then money[i]:=money[i]+850;
mx:=mx+money[i];
if money[i]>max then
begin
jj:=i;
max:=money[i];
end;
end;
writeln(name[jj]);
writeln(max);
writeln(mx);
end. -
0@ 2009-03-25 09:19:59
#include
#include
using namespace std;
#define N 100
#define M 20
int bij(int);
int a[N],b[N],c[N],m[N],n,big=0,z=0;
char name[N][M],bg[N],xb[N],first[N][M];
int main()
{
cin>>n;
for(int j=0;j>name[j]>>a[j]>>b[j]>>bg[j]>>xb[j]>>c[j];
for(int i=0;i80&&c[i]>=1)
m[i]+=8000;
if(a[i]>85&&b[i]>80)
m[i]+=4000;
if(a[i]>90)
m[i]+=2000;
if(a[i]>85&&xb[i]=='Y')
m[i]+=1000;
if(b[i]>80&&bg[i]=='Y')
m[i]+=850;
z+=m[i];
if(big -
0@ 2009-03-20 18:46:43
program p16;
var a,b:string;
e,f,i,j:longint;
d:char;function js(var a2:string):longint;
var cost,b2,b3,b4,b5,b6,b7,b8:longint; {qi mo pingjun chengji:b4}
c1,c2,c3:char; {c1:gb c2:west}
a3:string; {banji ping yi chengji:b5 b6:lun wen shu}
begin
cost:=0;
b8:=0;
b2:=1;
repeat
b2:=b2+1;
until ord(a2[b2])=32;
b2:=b2+1;
b3:=b2;
while (ord(a2[b3])32) do b3:=b3+1;
a3 := copy(a2, b2, b3-b2);
val(a3,b4,b8);
b3 := b3+1;
b2:=b3;
while (ord(a2[b3])32) do b3 := b3 +1;
a3 := copy(a2,b2,b3-b2);
val(a3,b5,b8);
b3:=b3+1;
c1:=a2[b3];
c2:=a2[b3+2];
b3:=b3+4;
b2:=b3;
if (ord(a2[b3+1])=48) then begin
a3 := copy(a2,b3,2);
val(a3,b6,b8);
end
else begin
a3 := copy(a2,b3,1);
val(a3,b6,b8);
end;
if (b5>80)and(c1='Y') then cost := cost+850;
if (b4>85)and(c2='Y') then cost := cost+1000;
if (b4>90) then cost := cost+2000;
if (b4>85)and(b5>80) then cost := cost+4000;
if (b4>80)and(b6>=1) then cost := cost+8000;
js := cost;
end;
begin
readln(e);
readln(a);
f:=f+js(a);
for j := 2 to e do begin
readln(b);
f:=f+js(b);
if js(b)>js(a) then a := b;
end;
j := 1;
while ord(a[j])32 do begin
write(a[j]);
j:=j+1;
end;
writeln;
writeln(js(a));
write(f);
end. -
0@ 2009-03-15 18:27:07
都什么破题解呀!
(.) (.)
---|---|---|---|--0oo0(_)0oo0--
|
全是错的 |
0oo0 0oo0 |
| | | | |
| | | | |
---|---|---|---|--(__)---|-(__)--| -
0@ 2009-03-14 12:02:10
#include
#includeint calculate(char *a)
{
int result=0, score,pyscore,wenshu;
char c[2];
sscanf(a,"%*s %d %d %c %c %d",&score,&pyscore,&c[0],&c[1],&wenshu);if(score>80 && wenshu>=1)
result+=8000;
if(score>85 && pyscore>80)
result+=4000;
if(score>90)
result+=2000;
if(c[1]=='Y' && score > 85)
result+=1000;
if(c[0]=='Y' && pyscore > 80)
result+=850;return result;
}int main()
{
int zuigao=0,result[100],total=0,i,j;
char s[50]={0},name[50],c;
scanf("%d",&i);
scanf("%c",&c);
for(j=0;j zuigao)
{
memset(name,0,sizeof(name));
sscanf(s,"%s %*d %*d %*c %*c %*d",name);
zuigao = result[j];
}
memset(s,0,sizeof(s));
}
printf("%s\n%d\n%d\n",name,zuigao,total);
return 0;
} -
0@ 2009-03-13 22:21:32
program p16;
var a,b:string;
e,f,i,j:longint;
d:char;function js(var a2:string):longint;
var cost,b2,b3,b4,b5,b6,b7,b8:longint; {qi mo pingjun chengji:b4}
c1,c2,c3:char; {c1:gb c2:west}
a3:string; {banji ping yi chengji:b5 b6:lun wen shu}
begin
cost:=0;
b8:=0;
b2:=1;
repeat
b2:=b2+1;
until ord(a2[b2])=32;
b2:=b2+1;
b3:=b2;
while (ord(a2[b3])32) do b3:=b3+1;
a3 := copy(a2, b2, b3-b2);
val(a3,b4,b8);
b3 := b3+1;
b2:=b3;
while (ord(a2[b3])32) do b3 := b3 +1;
a3 := copy(a2,b2,b3-b2);
val(a3,b5,b8);
b3:=b3+1;
c1:=a2[b3];
c2:=a2[b3+2];
b3:=b3+4;
b2:=b3;
if (ord(a2[b3+1])=48) then begin
a3 := copy(a2,b3,2);
val(a3,b6,b8);
end
else begin
a3 := copy(a2,b3,1);
val(a3,b6,b8);
end;
if (b5>80)and(c1='Y') then cost := cost+850;
if (b4>85)and(c2='Y') then cost := cost+1000;
if (b4>90) then cost := cost+2000;
if (b4>85)and(b5>80) then cost := cost+4000;
if (b4>80)and(b6>=1) then cost := cost+8000;
js := cost;
end;
begin
readln(e);
readln(a);
f:=f+js(a);
for j := 2 to e do begin
readln(b);
f:=f+js(b);
if js(b)>js(a) then a := b;
end;
j := 1;
while ord(a[j])32 do begin
write(a[j]);
j:=j+1;
end;
writeln;
writeln(js(a));
write(f);
end. -
0@ 2009-03-10 18:27:42
Type rec=record
all,name,w,c:string;
s,e,p:longint;
end;
Var
n,i,j,maxN,money,total:longint;
cop,maxP:string;
a:array[1..100] of rec;
Begin
maxN:=0;
total:=0;
j:=0;
readln(n);
For i:=1 to n do begin
readln(a[i].all);
while pos(' ',a[i].all)0 do begin
j:=j+1;
cop:=copy(a[i].all,1,pos(' ',a[i].all)-1);
case j of
1: a[i].name:=cop;
2: val(cop,a[i].s);
3: val(cop,a[i].e);
4: a[i].c:=cop;
5: a[i].w:=cop;
end;
delete(a[i].all,1,pos(' ',a[i].all));
if pos(' ',a[i].all)=0 then val(a[i].all,a[i].p);
end;
j:=0;
If (a[i].s>80) and (a[i].p>=1) then money:=8000;
If (a[i].s>85) and (a[i].e>80) then money:=money+4000;
If (a[i].s>90) then money:=money+2000;
If (a[i].s>85) and ((a[i].w='Y') or (a[i].w='y')) then money:=money+1000;
If (a[i].e>80) and ((a[i].c='Y') or (a[i].c='y')) then money:=money+850;
If (MaxN=0) or (money>MaxN) then begin
MaxN:=money;
MaxP:=a[i].name;
end;
Total:= Total + money ;
money:=0;
End;
Writeln(Maxp);
Writeln(Maxn);
Writeln(total);
End.