fork download
  1. #include <stdio.h>
  2.  
  3. int Inverte(int n) {
  4. int l = 0, j;
  5. while (n != 0) {
  6. j = n % 10;
  7. l = (l * 10) + j;
  8. n /= 10;
  9. }
  10. return l;
  11. }
  12. int main(void) {
  13. int i;
  14. scanf("%d", &i);
  15. printf(i == Inverte(i) ? "sim" : "nao");
  16. }
  17.  
  18. //https://pt.stackoverflow.com/q/340095/101
Success #stdin #stdout 0s 9424KB
stdin
1221
stdout
sim