Advertisement
STANAANDREY

pclab3 7

Oct 12th, 2022
615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.19 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.   int n;
  5.   printf("n="); scanf("%d", &n);
  6.   int r = 0;
  7.   while (n) {
  8.     r += (n % 10) % 2;
  9.     n /= 10;
  10.   }
  11.   printf("%d\n", r);
  12.   return 0;
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement