allekco

Вопрос 3

Oct 23rd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.32 KB | None | 0 0
  1. var
  2.     a, num, i, key, marker: integer;
  3. begin
  4.     readln(num);
  5.     a := num;
  6.     key := 0;
  7.     i := 1;
  8.     while i <= 3 do
  9.     begin
  10.         marker := a mod 10;
  11.         if marker = 1 then key := 1;
  12.         a := a div 10;
  13.         i := i + 1;
  14.     end;
  15. if key = 1 then writeln(2*num)
  16. else writeln(num*num);
  17. end.
Add Comment
Please, Sign In to add comment