- 水王争霸
- 2015-07-01 17:37:26 @
type
aa=record
name:string;
shui:string;
end;
var
n,i,j,l,bijiao:longint;
a:array[1..1000] of aa;
new1:aa;
procedure jiaohuan(x,y:integer);
var
t:aa;
begin
t.shui:=a[x].shui;
t.name:=a[x].name;
a[x].shui:=a[y].shui;
a[x].name:=a[y].name;
a[y].shui:=t.shui;
a[y].name:=t.name;
end;
begin
assign(input,'a.in');
assign(output,'a.out');
reset(input);
rewrite(output);
readln(n);
for i:=1 to n do
begin
readln(a[i].name);
readln(a[i].shui);
end;
for i:=1 to n-1 do
for j:=i+1 to n do
if length(a[i].shui)<length(a[j].shui) then jiaohuan(i,j) else
if length(a[i].shui)=length(a[j].shui) then
if a[i].shui<a[j].shui then jiaohuan(i,j) else
if a[i].name<a[j].name then jiaohuan(i,j);
for i:=1 to n do
writeln(a[i].name);
close(input);
close(output);
end.
////////////////
只得第一个点是怎么回事
2 条评论
-
yuruopu LV 4 @ 2016-10-16 08:56:46
// input code here
-
2015-07-01 17:39:36@
是不是因为在字符串中'A'<>'a' ,所以要改大小写啊
- 1