Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- a, num, i, key, marker: integer;
- begin
- readln(num);
- a := num;
- key := 0;
- i := 1;
- while i <= 3 do
- begin
- marker := a mod 10;
- if marker = 1 then key := 1;
- a := a div 10;
- i := i + 1;
- end;
- if key = 1 then writeln(2*num)
- else writeln(num*num);
- end.
Add Comment
Please, Sign In to add comment