Advertisement
Josif_tepe

Untitled

Nov 14th, 2022
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main() {
  6.     int A, B;
  7.     scanf("%d", &A);
  8.     scanf("%d", &B);
  9.    
  10.     for(int i = A; i <= B; i++) {
  11.         int pom = i;
  12.         int neparni_cifri = 0;
  13.         while(pom > 0) {
  14.             int posledna_cifra = pom % 10;
  15.             if(posledna_cifra % 2 == 1) {
  16.                 neparni_cifri++;
  17.             }
  18.             pom /= 10;
  19.         }
  20.         printf("%d %d\n", i, neparni_cifri);
  21.     }
  22.    
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement