515 条题解
-
0
卡尔王子 LV 7 @ 2008-10-06 16:51:56
type rec=record
name:string;
m1,m2,sum:longint;
c1,c2:char;
m:byte;
end;
var
a:array[1..100] of rec;
i,j,k,n,ans,max:longint;
c:char;
begin
readln(n);
for i:=1 to n do begin
read(c);
while c' ' do begin
a[i].name:=a[i].name+c;
read(c)
end;
read(a[i].m1);
read(a[i].m2);
read(c);
read(a[i].c1);
read(c);
read(a[i].c2);
read(a[i].m);
readln;
end;
for i:=1 to n do begin
if (a[i].m1>80) and (a[i].m>0) then begin
a[i].sum:=a[i].sum+8000;
ans:=ans+8000;
end;
if (a[i].m1>85) and (a[i].m2>80) then begin
a[i].sum:=a[i].sum+4000;
ans:=ans+4000;
end;
if a[i].m1>90 then begin
a[i].sum:=a[i].sum+2000;
ans:=ans+2000;
end;
if (a[i].m1>85) and (a[i].c2='Y') then begin
a[i].sum:=a[i].sum+1000;
ans:=ans+1000;
end;
if (a[i].m2>80) and (a[i].c1='Y') then begin
a[i].sum:=a[i].sum+850;
ans:=ans+850;
end;
end;
max:=0;
for i:=1 to n do
if a[i].sum>max then begin
k:=i;
max:=a[i].sum;
end;
writeln(a[k].name);
writeln(max);
writeln(ans);
end.
天啊,这水题我居然用了半个小时,和小学生一个水平,悲哀啊~~~~~~~~ -
02008-10-05 21:07:42@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms
小学生就用记录类型+字符串搞了半个小时AC。 -
02008-09-29 15:11:47@
var total,i,j,k,l,m,n,b,c:longint;
s,name:array[0..101] of string;
money,rmb:array[0..101] of longint;
flag1,flag2:array[0..101] of boolean;
temp:string;
a:longint;procedure qsort(l,r:longint);
var i,j,k,x:longint;
begin
i:=l;j:=r;x:=money[(i+j) div 2];
repeat
while money[i]x do dec(j);
if ij;
if i80) and (a>85) then money[i]:=money[i]+4000;
delete(s[i],1,k);
temp:=s;
if (temp='Y') and (b>80) then money[i]:=money[i]+850;
delete(s[i],1,2);
temp:=s;
if (temp='Y') and (a>85) then money[i]:=money[i]+1000;
delete(s[i],1,2);
temp:=s;
val(temp,c,l);
if (c>=1) and (a>80) then money[i]:=money[i]+8000;
end;
for i:=1 to n do begin
rmb[i]:=money[i];
total:=total+money[i];
end;
qsort(1,n);
for i:=1 to n do
if rmb[i]=money[n] then begin
writeln(name[i]);
writeln(rmb[i]);
writeln(total);
break;
end;
close(input);close(output);
end.
快排+字符串处理 -
02008-09-21 14:01:10@
#include
int main(){
int i,j,n,qm,py,lw,prize,max=0;
long total=0;
char a[20],name[20],xb,gb;
scanf("%d",&n);
for(i=1;i80)&&(lw>0)) prize+=8000;
if((qm>85)&&(py>80)) prize+=4000;
if(qm>90) prize+=2000;
if((qm>85)&&(xb=='Y')) prize+=1000;
if((py>80)&&(gb=='Y')) prize+=850;
total+=prize;
if(prize>max){
max=prize;
for(j=0;j -
02008-09-18 19:49:20@
program money;
var w,f,d:char; k,len,n,i,j,temp2,sum:integer; temp1:longint;
a:array [1..100,1..5] of longint;
b:array [1..100,1..2] of char;
c:array [1..100] of string;
temp3,e:string;
procedure se;
begin
if ((a>=80) and (a>0)) then a:=a+8000;
if ((a>=85) and (a>=80)) then a:=a+4000;
if (a>=90) then a:=a+2000;
if ((a>=85) and ((b='Y') or (b='y'))) then a:=a+1000;
if ((a>=80) and ((b='Y')or (b='y'))) then a:=a+850;
end;
begin
fillchar(a,sizeof(a),0);
readln(n);
for i:=1 to n do
begin
repeat
read(w);
if w' ' then c[i]:=c[i]+w;
until w=' ';
readln(a,a,f,b,d,b,a);
a:=i;
end;
for i:=1 to n do se;
for i:=1 to n-1 do
for j:=i+1 to n do
if ((aa))) then
begin
temp1:=a;
a:=a[j,4];
a[j,4]:=temp1;
temp2:=a;
a:=a[j,5];
a[j,5]:=temp2;
temp3:=c[i];
c[i]:=c[j];
c[j]:=temp3;
end;
sum:=0;
for i:=1 to n do sum:=sum+a;
writeln(c[1]);
writeln(a[1,4]);
writeln(sum);
end.
为什么错误啊? -
02008-09-12 21:17:05@
1读入数据2看符合条件的人可以得到得奖学金3输出得最大奖学金的人
-
02008-09-09 23:38:45@
这种水题需要的果然就是时间,去年在这卡了6次后GIVE UP,然后VIJOS就挂了。。。今年来一看。。。
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms
5) 班级贡献奖,每人850元,班级评议成绩高于80分(>80)的学生干部均可获得;
这里的班级评议成绩看成平均成绩了。。。靠,一道真正做了一年的题就这样解决了。 -
02008-09-05 19:55:00@
我是学C语言的,编程时要不要用文件?
-
02008-08-23 15:42:09@
#include
using namespace std;
struct abc
{
char name[20];
int a;
int b;
char gb;
char xb;
int c;
long int money;
};int main()
{
int n;
coutn;
abc *pn=new abc[n];
long int sum=0;
for(int i=0;i>pn[i].name>>pn[i].a>>pn[i].b>>pn[i].gb>>pn[i].xb>>pn[i].c;
sum=0;
if(pn[i].a>80&&pn[i].c>=1)//院士级
sum=sum+8000;
if(pn[i].a>85&&pn[i].b>80)//54级
sum=sum+4000;
if(pn[i].a>90)//成绩优秀
sum=sum+2000;
if(pn[i].a>85&&pn[i].xb=='Y')//西部奖
sum=sum+1000;
if(pn[i].b>80&&pn[i].gb=='Y')//班级
sum=sum+850;
pn[i].money=sum;
}
long int ko=pn[n-1].money;
int k=0;for(int j=n-1;j>=0;j--)// 比较谁得到最多奖金,顺序倒过来
{
if(pn[j].money>ko)
{
ko=pn[j].money;
k=j;
}
}
long int sumk=0;
for(i=0;i -
02008-08-18 11:30:58@
……这道题交了2遍,原来使用longint,晕,读入的时候我是边读边删的,这道题出了读入,其他都很简单
-
02008-08-17 13:54:54@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms
哈哈!AC的第二题,本人水平还很弱啊!c语言没那么多读入道道,用字符数组即可,不用判断什么空格。但注意循环最后要使个人奖金数归零,否则会叠加上去 -
02008-08-12 16:22:58@
main()
-
02008-08-12 09:09:47@
Accepted 有效得分:100 有效耗时:0ms
-
02008-08-10 15:00:35@
除了用STRING读入,还有什么办法读入啊,这道题的读入很麻烦!
-
02008-08-03 09:54:03@
这题有几点,
1、读入有点麻烦(1行读了3种类型)。字符串用字符读,读第4,5项(字符)时注意不要把前面的一个空格读了,可以随便用个变量读空格,跳过再读字符。
2、计算奖学金时可以优化一下。
3、奖学金与总的要用longint。
Ps、我是读一行,做一行。用2个变量保存最多奖学金以及那个人的名字(每做一次比较)。
一次AC。呵呵。
-
02008-08-01 08:20:10@
太晕了
-
02008-07-30 19:13:59@
我对这道题很郁闷,交了10次才过...
PIA~
第一次是因为把C++错选成了PASCAL,
后面8次是因为多输出了中间检查的东西...
PIA~
强烈鄙视自己一个,
顺便鄙视这道题一个... -
02008-07-29 20:01:45@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms第三个AC的题,第一个没看题解,自己做的,很有成就感,不过总觉得这是最简单的一道题。
-
02008-07-20 19:39:33@
不断的判断啊
简直是送分…… -
02008-07-17 15:39:54@
*注意如果最大值不唯一只输出第一个
……估计也就我在这儿错了,这破题都这样……疯了……