fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int x;
  7. cin>>x;
  8. if(x<0){
  9. cout<<"T"<<endl;
  10.  
  11. }
  12.  
  13. else{
  14. string str= to_string(x);
  15. int a=0,b=str.length()-1;
  16.  
  17. while(a<=b){
  18. if(str[a]!=str[b]){
  19. cout<<"F"<<endl;
  20. return 0;
  21. }
  22. a++;
  23. b--;
  24. }
  25. cout<<"T"<<endl;
  26.  
  27. }
  28. return 0;
  29. }
Success #stdin #stdout 0.01s 5536KB
stdin
11211
stdout
T