511 条题解
-
0
beiiweiideme LV 8 @ 2008-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@
*注意如果最大值不唯一只输出第一个
……估计也就我在这儿错了,这破题都这样……疯了…… -
02008-01-04 20:41:58@
这道题应该是对列吧
-
02007-12-16 11:51:43@
怎么算了
那么复杂!!
不懂哦!!! -
02007-12-14 15:31:04@
ggagagaegagadgsdgasdfga
-
02007-12-04 19:54:34@
字符串要会处理