Advertisement
Josif_tepe

Untitled

Mar 21st, 2024
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.    
  5.     int a, b;
  6.     scanf("%d%d", &a, &b);
  7.  
  8.     for(int i = a; i <= b; i++) {
  9.         int tmp = i, broj = 0;
  10.         while(tmp > 0) {
  11.             int cifra = tmp % 10;
  12.             broj = (broj * 10) + cifra;
  13.             tmp /= 10;
  14.         }
  15.         if(i == broj) {
  16.             printf("%d ", i);
  17.         }
  18.     }
  19.    
  20.        return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement