Advertisement
Guest User

Untitled

a guest
May 24th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. int main () {
  2. int nombre_partides;
  3. cin >> nombre_partides;
  4. for (int i=0; i<nombre_partides; ++i) {
  5. bool anna=false;
  6. bool bernat=false;
  7. vector<string> v(10);
  8. for (int j=0; j<10; ++j) cin >> v[j];
  9. for (int j=1; j<10 and not anna and not bernat; ++j) {
  10. if (v[j-1][v[j-1].size()-1] != v[j][0] and j%2==0) bernat=true;
  11. if (v[j-1][v[j-1].size()-1] != v[j][0] and j%2!=0) anna=true;
  12. }
  13. if (anna) cout << "A" << endl;
  14. else if (bernat) cout << "B" << endl;
  15. else cout << "=" << endl;
  16.  
  17.  
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement