csansoon

P1.16 P51352 Elementos

Sep 19th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6.     char x,y;
  7.     cin >> x >> y;
  8.    
  9.     if (x=='A') {
  10.         if (y=='A') {cout << "-" << endl;}
  11.         if (y=='P') {cout << "1" << endl;}
  12.         if (y=='V') {cout << "2" << endl;}
  13.     }
  14.    
  15.     if (x=='P') {
  16.         if (y=='A') {cout << "2" << endl;}
  17.         if (y=='P') {cout << "-" << endl;}
  18.         if (y=='V') {cout << "1" << endl;}
  19.     }
  20.    
  21.     if (x=='V') {
  22.         if (y=='A') {cout << "1" << endl;}
  23.         if (y=='P') {cout << "2" << endl;}
  24.         if (y=='V') {cout << "-" << endl;}
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment