|
|
вернуться в форумhelp Послано Dima 1 авг 2012 04:48 Re: help Послано Dima 1 авг 2012 04:49 var n,i,a,j,m:integer;q:string;b:real; s:array[1..1000]of string; begin readln(n); b:=99999999999; m:=0; for i:=1 to n do begin readln(q); for j:=1 to length(q) do if q[j]=' ' then a:=j; if (((ord(q[a+1])-48)*10+(ord(q[a+2])-48))*60+((ord(q[a+4])-48)*10+(ord(q[a+5])-48))+(ord(q[a+7])-48)/10<b) then begin inc(m); s[i]:=copy(q,1,a-1); b:=((ord(q[a+1])-48)*10+(ord(q[a+2])-48))*60+((ord(q[a+4])-48)*10+(ord(q[a+5])-48))+(ord(q[a+7])-48)/10; end; end; for i:=1 to n do for j:=1 to n-1 do if s[j]>s[j+1]then begin q:=s[j];s[j]:=s[j+1];s[j+1]:=q; end; writeln(m); for i:=1 to n do if s[i]<>'' then writeln(s[i]); end. |
|
|