Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x := 1;
- Reset(File1);
- While Not eof(File1) do
- Begin
- Read(File1, num[i]);
- Inc(i)
- End;
- z := i;
- j := z + 1;
- While Not eof(File1) do
- Begin
- Read(File1, num[j]);
- Inc(j)
- End;
- y := j;
- If j > i Then a := 1 Else If j = i Then
- Begin
- While z <> x do
- Begin
- If Ord(num[j]) > Ord(num[i]) Then a := 1 Else If Ord(num[j]) < Ord(num[i]) Then a := 0;
- Dec(j);
- Dec(i)
- End;
- End Else a := 0;
- If a = 1 Then
- Begin
- x := z+1;
- z := y
- End;
- var f1,f2: text;
- s,s2:string;
- begin
- assign(f1,'input.txt');
- assign(f2,'output.txt');
- reset(f1);rewrite(f2);
- readln(f1,s);
- readln(f1,s2);
- if s=s2 then writeln(0);
- close(f1);
- close(f2);
- end.
Add Comment
Please, Sign In to add comment