522 条题解
-
0
ashuai LV 8 @ 2009-01-21 13:54:18
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms#include
#include
using namespace std;struct student{
string name;
int score_final;
int score_usual;
char cadre;
char western;
int paper;
int scholar;
};void yuanshi(student &stu);
void wusi(student &stu);
void chengji(student &stu);
void xibu(student &stu);
void banji(student &stu);int main()
{
int n,i,max = 0,sum = 0;
cin>>n;
student stu[n];
for(i = 0; i < n; i++)
{
cin>>stu[i].namestu[i].score_final
stu[i].score_usual
stu[i].cadre
stu[i].western
stu[i].paper;
stu[i].scholar = 0;//计算奖学金
yuanshi(stu[i]);
wusi(stu[i]);
chengji(stu[i]);
xibu(stu[i]);
banji(stu[i]);//找到最大奖学金及奖学金总额
sum += stu[i].scholar;
if(stu[i].scholar > stu[max].scholar)
max = i;
}
cout -
0@ 2009-01-19 19:07:27
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0msprogram 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-01-11 19:15:31
program p1001;
varname:array [1..100] of string;
res:array [1..100,1..2] of integer;
oth:array [1..100,1..2] of char;
lun:array [1..100] of integer;
tot:array [1..100] of integer;
n,i,max,number:integer;
ch,f1,f2:char;
sum:longint;
begin
read(n);
for i:=1 to n do
beginread(ch);
while ch' ' do
begin
name[i]:=name[i]+ch;
read(ch);
end;
readln(res,res,f1,oth,f2,oth,lun[i]);
end;for i:=1 to n do
tot[i]:=0;
for i:=1 to n do
begin
if (res>80)and(lun[i]0) then tot[i]:=tot[i]+8000;
if (res>85)and(res>80) then tot[i]:=tot[i]+4000;
if (res>90) then tot[i]:=tot[i]+2000;
if (oth='Y')and(res>85) then tot[i]:=tot[i]+1000;
if (oth='Y')and(res>80) then tot[i]:=tot[i]+850;
end;
sum:=0;
for i:=1 to n do
sum:=sum+tot[i];
max:=0;
for i:=1 to n do
if max -
0@ 2009-01-10 10:12:34
program vip1001(input,output);
var
n:integer;
star:string;
mony:array[1..1000]of longint;
infor:array[1..100,1..6]of string;
infor2:array[1..100,1..3]of integer;
i,j,max,min,k:longint;
begin
{assign(input,'vip1001.in');
assign(output,'vip1001.out');
reset(input);
rewrite(output);}
readln(n);for i:=1 to n do
begin
readln(star);
for j:=1 to 6 do
begin
infor[i][j]:=copy(star,1,pos(' ',star)-1);
delete(star,1,pos(' ',star));
if j=6
then infor[i][j]:=copy(star,1,length(star));
end;
end;for i:=1 to n do
begin
val(infor[i][2],infor2[i][1]);
val(infor[i][3],infor2[i][2]);
val(infor[i][6],infor2[i][3]);
end;
fillchar(mony,sizeof(mony),0);
for i:=1 to n do
begin
if (infor2[i][1]>80) and (infor2[i][3]>=1)
then mony[i]:=mony[i]+8000;
if (infor2[i][1]>85) and (infor2[i][2]>80)
then mony[i]:=mony[i]+4000;
if infor2[i][1]>90
then mony[i]:=mony[i]+2000;
if (infor2[i][1]>85) and (infor[i][5]='Y')
then mony[i]:=mony[i]+1000;
if (infor2[i][2]>80) and (infor[i][4]='Y')
then mony[i]:=mony[i]+850;
end;min:=0;
max:=-maxint;
for i:=1 to n do
min:=min+mony[i];for i:=1 to n do
if mony[i]>max
then begin max:=mony[i];k:=i;end;
writeln(infor[k][1]);
writeln(mony[k]);
writeln(min);end.
AC了 原来'100' -
0@ 2009-01-06 17:07:30
#inlclude
using namespace std;
int main()
{int *p1,*p2,*p,a,b;
cin>>a>>b;
p1=&a;
p2=&b;
if(a -
0@ 2009-01-06 11:02:14
var
n,m,i,j,qm,bj,lw,max,cd,jxj:integer;
stu,b,c,d,gb,xb,xm,nm:string;
sum:longint;
procedure kg(var k:integer);
begin
k:=pos(' ',stu);
end;
procedure del(i:integer);
begin
delete(stu,1,i);
end;begin
readln(n);
if(n>100) or (n80)and(lw>0) then jxj:=jxj+8000;
if(qm>85)and(bj>80) then jxj:=jxj+4000;
if(qm>90) then jxj:=jxj+2000;
if(qm>85) and (xb='Y') then jxj:=jxj+1000;
if(bj>80) and (gb='Y') then jxj:=jxj+850;if jxj>max then
begin
max:=jxj;
xm:=nm;
end;
sum:=sum+jxj;
jxj:=0;
end;writeln(xm);
writeln(max);
writeln(sum);end.
-
0@ 2009-01-01 21:44:05
struct student
{
char name;
int qj;
int bj;
int lw;
char bg;
char zb;
}student[100];
main()
{
struct student student[100];
int i,d,max,sum1,sum2;
char n;
max=0;
sum1=0;
sum2=0;
scanf("%d",&d);
for(i=1;i80)&&(student[i].qj>85))
sum1=sum1+4000;
if(student[i].qj>90)
sum1=sum1+2000;
if((student[i].zb=='Y')&&(student[i].qj>85))
sum1=sum1+1000;
if((student[i].bj=='Y')&&(student[i].bj>80))
sum1=sum1+850;
sum2=sum2+sum1;
if(max -
0@ 2008-12-21 13:40:18
var i,j,k,n,m,p,ts,b:integer; tm:string[20]; ch:char; a:array[1..100]of integer;
s:array[1..101,1..9]of integer; name:array[1..100]of string[20];
begin
assign(input,'result.in');reset(input);
assign(output,'result.out');rewrite(output);
readln(n,m);
for i:=1 to n do
begin
name[i]:='';
read(ch);
while ch' ' do
begin
name[i]:=name[i]+ch;
read(ch);
end;
for j:=1 to m do read(s); readln;
end;
close(input);{ writeln(n,' ',m);
for i:=1 to n do
begin
write(name[i]); for j:=1 to m do write(' ',s); writeln;
end;
writeln;}for i:=1 to n do
begin
s:=0;
for j:=1 to m do s:=s+s;
end;for i:=1 to n-1 do
for j:=i+1 to n do
if s -
0@ 2008-12-18 16:59:19
var i,j,k,n,m,p,ts,b:integer; tm:string[20]; ch:char; a:array[1..100]of integer;
s:array[1..101,1..9]of integer; name:array[1..100]of string[20];
begin
assign(input,'result.in');reset(input);
assign(output,'result.out');rewrite(output);
readln(n,m);
for i:=1 to n do
begin
name[i]:='';
read(ch);
while ch' ' do
begin
name[i]:=name[i]+ch;
read(ch);
end;
for j:=1 to m do read(s); readln;
end;
close(input);{ writeln(n,' ',m);
for i:=1 to n do
begin
write(name[i]); for j:=1 to m do write(' ',s); writeln;
end;
writeln;}for i:=1 to n do
begin
s:=0;
for j:=1 to m do s:=s+s;
end;for i:=1 to n-1 do
for j:=i+1 to n do
if s -
0@ 2008-12-16 22:07:31
readln(n);
for i:=1 to n do
begin
read(ch);
while
read(ch);
end;
readln(a1[i],a2[i],ch,a3[i],ch,a4[i],ch,a5[i]);
end;
for i:=1 to n do
begin
p:=0;
if (a1[i]>80)and(a5[i]>=1) then inc(p,8000);
if (a1[i]>85)and(a2[i]>80) then inc(p,4000);
if (a1[i]>90) then inc(p,2000);
if (a1[i]>85)and(a4[i]='Y') then inc(p,1000);
if (a2[i]>80)and(a3[i]='Y') then inc(p,850);
if p>max then
begin
max:=p;
maxname:=name[i];
end;
inc(total,p);
end;
writeln(maxname);
writeln(max);
writeln(total);
end. -
0@ 2008-12-13 17:35:29
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms太弱了~
-
0@ 2008-12-13 15:19:39
var
n,i:integer;
name:array[1..100]of string;
a1,a2,a5:array[1..100]of integer;
a3,a4:array[1..100]of char;
max,p,total:longint;
maxname:string;
ch:char;
begin
readln(n);
for i:=1 to n do
begin
read(ch);
while ch' ' do
begin
name[i]:=name[i]+ch;
read(ch);
end;
readln(a1[i],a2[i],ch,a3[i],ch,a4[i],ch,a5[i]);
end;
for i:=1 to n do
begin
p:=0;
if (a1[i]>80)and(a5[i]>=1) then inc(p,8000);
if (a1[i]>85)and(a2[i]>80) then inc(p,4000);
if (a1[i]>90) then inc(p,2000);
if (a1[i]>85)and(a4[i]='Y') then inc(p,1000);
if (a2[i]>80)and(a3[i]='Y') then inc(p,850);
if p>max then
begin
max:=p;
maxname:=name[i];
end;
inc(total,p);
end;
writeln(maxname);
writeln(max);
writeln(total);
end. -
0@ 2008-12-13 13:35:37
此程序显示编译错误,请问怎么修改?
#include
#include
#include
int main()
{
struct student
{char name[20];
int score1;
int score2;
char xuegan;
char xibu;
int lunwen;
}student[100];
int num,i,zong,zui=0,money[100]={0};
char bin[20];
FILE *fin=fopen("P1001.in","r");
FILE *fout=fopen("P1001.out","w");
fscanf(fin,"%d",&num);
for(i=0;i=num;i++)
fscanf(fin,"%s %d %d %c %c %d ",&student[i].name,&student[i].score1,&student[i].score2,&student[i].xuegan,&student[i].xibu,&student[i].lunwen);
for(i=0;i=num;i++)
{if((student[i].score1>80)&&(student[i].lunwen!=0))
money[i]+=8000;
else if((student[i].score1>85)&&(student[i].score2>80))
money[i]+=4000;
else if(student[i].score1>90)
money[i]+=2000;
else if((student[i].score1>85)&&(student[i].xibu='Y'))
money[i]+=1000;
else if((student[i].score2>80)&&(student[i].xuegan='Y'))
money[i]+=850;
}
for(i=0;i=num;i++)
{zong+=money[i];
if(money[i] -
0@ 2008-12-10 12:44:17
program jiang;
type
node=record
na:string;
mo,yi,lun:integer;
gan,xi:char;
end;
var
a:array[1..200] of node;
sum:array[1..200] of integer;
s:string; all:longint;
n:integer;
procedure init;
var
i,k:integer; p:char;
begin
fillchar(sum,sizeof(sum),0);
readln(n);
for i:=1 to n do
begin
readln(s);
k:=pos(' ',s);
with a[i] do
begin
na:=copy(s,1,k-1);
delete(s,1,k);
k:=pos(' ',s);
val(copy(s,1,k-1),mo);
delete(s,1,k);
k:=pos(' ',s);
val(copy(s,1,k-1),yi);
delete(s,1,k);
gan:=s[1];
delete(s,1,2);
xi:=s[1];
delete(s,1,1);
val(s,lun);
end;
end;
{for i:=1 to n do
with a[i] do
begin
write(na,' ',mo,' ',yi,' ',gan,' ',xi,' ',lun);
writeln;
end;}
end;
procedure main;
var
i:integer; q:longint;
begin
all:=0;
for i:=1 to n do
with a[i] do
begin
q:=0;
if (mo>80) and (lun>=1) then inc(q,8000);
if (mo>85) and (yi>80) then inc(q,4000);
if (mo>90) then inc(q,2000);
if (xi='Y') and (mo>85) then inc(q,1000);
if (yi>80) and (gan='Y') then inc(q,850);
sum[i]:=q; inc(all,q);
end;
end;
procedure print;
var
i,max,bb:integer;
begin
max:=0;
for i:=1 to n do if sum[i]>max then max:=sum[i];
for i:=1 to n do
if sum[i]=max then begin bb:=i; break; end;
with a[bb] do
begin
writeln(na);
writeln(max);
end;
writeln(all);
end;
begin
init;
main;
print;
end. -
0@ 2008-12-07 16:39:45
很难啊!
不会做啊!
大牛们教教我吧!
可怜我这个乞丐仔吧!
我已经五天没有吃饭啦!
我已经三年没有洗澡啦!
行行好,给几个零钱,让我吃点面包粒吧!
我很惨啊!
救救我啊!
我上有九十岁的祖母!
下有刚出生的孙子!
一家有二十多个人,帮帮我吧! -
0@ 2008-12-06 15:28:19
var
sum,max:longint;
k,n,i,c:integer;
s:string;
name:array[1..100]of string;
f:array[1..1000]of longint;
wen,fen,ping:array[1..100]of integer;
gan,xibu:array[1..100]of boolean;
beginreadln(n);
for i:=1 to n do
begin
readln(s);
k:=pos(' ',s);
name[i]:=copy(s,1,k-1);
delete(s,1,k);
k:=pos(' ',s);
val(copy(s,1,k-1),fen[i],c);
delete(s,1,k);
k:=pos(' ',s);
val(copy(s,1,k-1),ping[i],c);
delete(s,1,k);
if s[1]='Y' then gan[i]:=true else gan[i]:=false;
if s[3]='Y' then xibu[i]:=true else xibu[i]:=false;
delete(s,1,4);
val(s,wen[i],c);
end;fillchar(f,sizeof(f),0);
max:=0;sum:=0;
for i:=1 to n do
begin
if (fen[i]>80)and(wen[i]>=1)then f[i]:=f[i]+8000;
if (fen[i]>85)and(ping[i]>80)then f[i]:=f[i]+4000;
if fen[i]>90 then f[i]:=f[i]+2000;
if (fen[i]>85)and(xibu[i]=true)then f[i]:=f[i]+1000;
if (ping[i]>80)and(gan[i]=true )then f[i]:=f[i]+850;
sum:=sum+f[i];
if max=0 then max:=i
else
if f[i]>f[max]then max:=i;
end;
writeln(name[max]);
writeln(f[max]);
writeln(sum);
end. -
0@ 2008-12-11 00:13:15
program jingjin;
var t,max:record
name:string;
qimo:0..100;
banji:0..100;
ganbu:boolean;
xibu:boolean;
lunwen:0..10;
all:longint;
end;
n,i,j,s,g1,g2,num:longint;
gan,xi:char;
ming:char;
begin
readln(n);
max.all:=0;
t.all:=0;
s:=0;
for i:=1 to n do
begin
with t do
while ming' ' do
begin
name:=name+ming;
read(ming);
end;
with t do
begin
read(g1,g2,gan,xi,num);
qimo:=g1;
banji:=g2;
if gan='Y' then ganbu:=true;
if gan='N' then ganbu:=false;
if xi='Y' then xibu:=true;
if xi='N' then xibu:=false;
lunwen:=num;
end;
if (t.qimo>80)and(t.lunwen>=1) then t.all:=t.all+8000;
if t.qimo>85 then
begin
if t.banji>80 then t.all:=t.all+4000;
if t.xibu then t.all:=t.all+1000;
end;
if t.qimo>90 then t.all:=t.all+2000;
if (t.banji>80)and(t.ganbu) then t.all:=t.all+850;
if t.all>max.all then max:=t;
s:=s+t.all;
writeln;
end;
writeln(max.name);
writeln(max.all);
writeln(s);
end. -
0@ 2008-12-02 13:44:57
program p1001;
var s,name,maxname,xsgb,xbxs:string;
s1,i,e,v,max,lw,pj,py:longint;
ok,n,l:integer;
procedure dq;
var e,i:integer;
begin
for i:=1 to l do if s[i]=' ' then begin e:=i; break; end;
name:=copy(s,1,e-1); delete(s,1,e);
for i:=1 to l do if s[i]=' ' then begin e:=i; break; end;
val(copy(s,1,e-1),pj,ok); delete(s,1,e);
for i:=1 to l do if s[i]=' ' then begin e:=i; break; end;
val(copy(s,1,e-1),py,ok); delete(s,1,e);
for i:=1 to l do if s[i]=' ' then begin e:=i; break; end;
xsgb:=copy(s,1,e-1); delete(s,1,e);
for i:=1 to l do if s[i]=' ' then begin e:=i; break; end;
xbxs:=copy(s,1,e-1); delete(s,1,e); val(s,lw,ok);
end;
begin
readln(n); max:=0;
for i:=1 to n do begin
readln(s); v:=0; l:=length(s);
dq;
if (lw>=1)and(pj>80) then v:=v+8000;
if (pj>85)and(py>80) then v:=v+4000;
if pj>90 then v:=v+2000;
if (pj>85)and(xbxs='Y') then v:=v+1000;
if (py>80)and(xsgb='Y') then v:=v+850;
s1:=s1+v; if v>max then begin max:=v; maxname:=name; end;
end;
writeln(maxname); writeln(max); writeln(s1);
end.AC了了了了了了
-
0@ 2008-11-28 19:08:58
type
student=
record
scholar:longint;
name:string;
end;
var
n,d1,d2,d5,i,maxscholar,total:longint;
ch,d3,d4:char;
s:array [1..100] of student;
maxname:string;
begin
maxscholar:=0;
total:=0;
for i:=1 to 100 do
begin
s[i].scholar:=0;
s[i].name:='';
end;
readln(n);
for i:=1 to n do
begin
d1:=0;
d2:=0;
d5:=0;
read(ch);
repeat
s[i].name:=s[i].name+ch;
read(ch);
until ch=' ';
read(ch);
repeat
d1:=d1*10+ord(ch)-48;
read(ch);
until ch=' ';
read(ch);
repeat
d2:=d2*10+ord(ch)-48;
read(ch);
until ch=' ';
read(d3);
read(ch);
read(d4);
read(ch);
read(ch);
repeat
d5:=d5*10+ord(ch)-48;
read(ch);
until ch=chr(13);
readln;
if (d1>80) and (d5>=1) then s[i].scholar:=s[i].scholar+8000;
if (d1>85) and (d2>80) then s[i].scholar:=s[i].scholar+4000;
if d1>90 then s[i].scholar:=s[i].scholar+2000;
if (d1>85) and (d4='Y') then s[i].scholar:=s[i].scholar+1000;
if (d2>80) and (d3='Y') then s[i].scholar:=s[i].scholar+850;
if s[i].scholar>maxscholar then
begin
maxname:=s[i].name;
maxscholar:=s[i].scholar;
end;
total:=total+s[i].scholar;
end;
writeln(maxname);
writeln(maxscholar);
writeln(total);
end. -
0@ 2008-11-27 14:23:20
program jxj;
type
student=record
xm:string;
mark1,mark2,ly:longint;
s,gb,xb:char;
end;
sj=array[1..100] of student;
var
ts,best,bxx,i,n:integer;
tsj:sj;
mark:array[1..100] of integer;
begin
read(n);
for i:=1 to n do
begin
with tsj[i] do
begin
repeat
read(s);
if s=' ' then break;
xm:=xm+s;
until 11;
end;
read(tsj[i].mark1);
read(tsj[i].mark2);
read(tsj[i].gb);
read(tsj[i].xb);
read(ly);
mark[i]:=0;
best:=0;
if (mark1>80) and (ly>=1) then mark[i]:=mark[i]+8000;
if (mark1>85) and (mark2>80) then mark[i]:=mark[i]+4000;
if mark1>90 then mark[i]:=mark[i]+2000;
if (mark1>85) and (xb='Y') then mark[i]:=mark[i]+1000;
if (mark2>80) and (gb='Y') then mark[i]:=mark[i]+850;
if mark[i]>best then
begin
best:=mark[i];
bxx:=i;
end;
ts:=ts+mark[i];
end;
write(tsj[bxx].xm);
writeln(best);
writeln(ts)
end.