Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- n, c, m: Integer;
- isset: Boolean;
- begin
- isset := False;
- c := 1;
- m := 0;
- repeat
- write('Please, enter the ', c, 'th number or negative to exit: ');
- readln(n);
- Inc(c);
- if (n > 0) and (n mod 10 = 3) then
- begin
- if (not isset) then
- m := n
- else begin
- if (n > m) then
- m := n;
- end;
- isset := True;
- end;
- until (n < 0);
- if (isset) then
- writeln('The biggest number ended with 3 is ', m)
- else
- writeln('No number with 3 at end was found');
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment