Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- using namespace std;
- int trans1 (char c){
- if (c=='D') return 1;
- if (c=='C') return 2;
- if (c=='B') return 3;
- if (c=='A') return 4;
- }
- char trans2 (int n){
- if (n==1) return 'D';
- if (n==2) return 'C';
- if (n==3) return 'B';
- if (n==4) return 'A';
- }
- int main(){
- char c,cc;
- int x,y,;
- cin>>c>>x;
- y=trans1 (c);
- if ((y>6)or(y<1)or(x>6)or(x<1)) cout<<"?"<<endl;
- else{
- if ((y-1)>=1) cout<< trans2 (y-1)<<x<<endl;
- else cout<<"--"<<endl;
- if ((x+1)<=6) cout<<c<<x+1<<endl;
- else cout<<"--"<<endl;
- if ((y+1)<=4) cout<<trans2 (y+1)<<x<<endl;
- else cout<<"--"<<endl;
- if ((x-1)>=1) cout<<c<<x-1<<endl;
- else cout<<"--"<<endl;
- }
- system("pause");
- }
Add Comment
Please, Sign In to add comment