fork download
  1. #include <stdio.h>
  2. int main(){
  3. int x, n, bilangan, sisa;
  4.  
  5. scanf("%d", &x);
  6. for(int i = 0; i < x; i++){
  7. int terbalik = 0;
  8. scanf("%d", &bilangan);
  9.  
  10. n = bilangan;
  11.  
  12. while (n !=0){
  13. sisa = n%10;
  14. terbalik = terbalik*10+sisa;
  15. n/=10;
  16. }
  17. if (terbalik == bilangan){
  18. printf("1\n");
  19. }else printf("0\n");
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5324KB
stdin
5
2334332
555
1234
50
123
stdout
1
1
0
0
0