fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int q;
  5. string s;
  6.  
  7. int main() {
  8. cin >> q;
  9. vector<int> ans;
  10. while(q--){
  11. cin >> s;
  12. int l = 0, r = s.size()-1;
  13. int ok = 1;
  14. while(l <= r){
  15. if(s[l] != s[r]){
  16. // -> không đối xứng
  17. ok = 0;
  18. break;
  19. }
  20. l++;
  21. r--;
  22. }
  23. ans.push_back(ok);
  24. }
  25. for(int i : ans) cout << i;
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty