Advertisement
basilkot

Untitled

Nov 28th, 2022
1,064
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.32 KB | None | 0 0
  1. Program Task2(output);
  2.     var odd, even, val: longint;
  3. begin
  4.     odd := 0;
  5.     even := 0;
  6.  
  7.     readln(val);
  8.  
  9.     repeat
  10.         if val mod 2 = 0 then
  11.             even := even + 1
  12.         else
  13.             odd := odd + 1;
  14.         val := val div 10
  15.     until val = 0;
  16.    
  17.     writeln(even);
  18.     writeln(odd)
  19. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement