YorKnEz

Chess Tournament IOIT

Nov 15th, 2021 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cstring>
  4.  
  5. using namespace std;
  6.  
  7. char s[5001];
  8. int t;
  9.  
  10. int main() {
  11. freopen("data.in", "r", stdin);
  12. freopen("data.out", "w", stdout);
  13.  
  14. cin >> t;
  15. cin.get();
  16.  
  17. for (int i = 0; i < t; i++) {
  18. cin.getline(s, 5001);
  19.  
  20. if (!strchr(s, '#')) {
  21. cout << "Draw" << endl;
  22. } else {
  23. char *p;
  24.  
  25. p = strrchr(s, '.');
  26.  
  27. char *c;
  28.  
  29. c = strtok(p+1, " ");
  30. c = strtok(NULL, " ");
  31.  
  32. if (c) cout << "Second" << endl;
  33. else cout << "First" << endl;
  34. }
  35. }
  36.  
  37. return 0;
  38. }
Add Comment
Please, Sign In to add comment