Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define op ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
- int main()
- {
- op;
- int t;
- cin>>t;
- while(t--){
- string ss;
- cin>>ss;
- int s=0;
- for(auto u : ss)
- s+=(u-'0');
- string p =to_string(s);
- string tm =p;
- reverse(tm.begin(),tm.end());
- cout<<(tm== p ? "YES" : "NO")<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement