- 奖学金
- 2009-08-27 15:42:55 @
我的程序如下:
program p2(input,output);
var
n,i,j,m:1..maxint;
a,chinese,english,math:array[1..maxint] of 1..100;
mark:array[1..maxint] of 1..300;
begin
readln(n);
for i:=1 to n do
begin
readln(chinese[i],english[i],math[i]);
mark[i]:=chinese[i]+math[i]+english[i];
a[i]:=i;
end;
for i:=1 to 5 do
for j:=i+1 to n do
if mark[i]
2 条评论
-
peng7621260 LV 9 @ 2009-08-27 21:06:35
int cmp(const void *a,const void b)
{
node n1=(node )a;
node n2=(node *)b;
if(n1.sum!=n2.sum) return n2.sum-n1.sum;
else if(n1.yu!=n2.yu)
return n2.yu-n1.yu;
else
return n1.xue-n2.xue;
}用C就方便了
-
2009-08-27 19:03:46@
答案错误还是超时?
没看错的话你貌似用的是冒泡排序?
- 1