Advertisement
Josif_tepe

Untitled

Dec 21st, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int N;
  6.     int prevrten_broj=0;
  7.     scanf("%d",&N);
  8.     for(int i=0;i<N;i++){
  9.         int X;
  10.         scanf("%d",&X);
  11.         prevrten_broj = 0;
  12.         for(int j=X;j>0;j/=10){
  13.             int cifra=j%10;
  14.             prevrten_broj=(prevrten_broj*10)+cifra;
  15.         }
  16.         if(X == prevrten_broj){
  17.             printf("Brojot e palindrom\n");
  18.         }
  19.         else {
  20.             printf("Brojot ne e polindrom\n");
  21.         }
  22.     }
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement