igorich1376

While4

Feb 2nd, 2026
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.15 KB | None | 0 0
  1. ##
  2. uses PT4; Task('while4');
  3. var n := ReadInteger;
  4. while n >= 1 do
  5.   if n mod 3 = 0 then n := n div 3 else break;
  6. Print(if n = 1 then True else False)
Advertisement
Add Comment
Please, Sign In to add comment