Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- _test
- {
- string s;
- cin>>s;
- set<string> ans;
- string x, y;
- x = s, y = s;
- for(char c='a'; c<='h'; c++)
- {
- x[0] = c;
- ans.insert(x);
- }
- for(char c='1'; c<='8'; c++)
- {
- y[1] = c;
- ans.insert(y);
- }
- ans.erase(s);
- for(auto e: ans)
- cout<<e<<"\n";
- cout<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment