Advertisement
Rentib

Untitled

Mar 18th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main(){
  4. ios_base::sync_with_stdio(0);
  5. cin.tie(0);
  6. char z;
  7. int n, s = 8;
  8. cin >> z >> n;
  9. if((n == 1 || n == 8) && (z != 'a' && z != 'h')) cout << 5;
  10. else if((n != 1 && n != 8) && (z == 'a' || z == 'h')) cout << 5;
  11. else if((n == 1 || n == 8) && (z == 'a' || z == 'h')) cout << 3;
  12. else cout << 8;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement