bab_mail

http://otvet.mail.ru/question/90585465

May 30th, 2013
1,511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.56 KB | None | 0 0
  1. var
  2.   n, c, m: Integer;
  3.   isset: Boolean;
  4. begin
  5.   isset := False;
  6.   c := 1;
  7.   m := 0;
  8.   repeat
  9.     write('Please, enter the ', c, 'th number or negative to exit: ');
  10.     readln(n);
  11.     Inc(c);
  12.     if (n > 0) and (n mod 10 = 3) then
  13.     begin
  14.       if (not isset) then
  15.         m := n
  16.       else begin
  17.         if (n > m) then
  18.           m := n;
  19.       end;
  20.       isset := True;
  21.     end;
  22.   until (n < 0);
  23.   if (isset) then
  24.     writeln('The biggest number ended with 3 is ', m)
  25.   else
  26.     writeln('No number with 3 at end was found');
  27.   readln;
  28. end.
Advertisement
Add Comment
Please, Sign In to add comment