Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. /**
  9.  * Auto-generated code below aims at helping you parse
  10.  * the standard input according to the problem statement.
  11.  **/
  12. int main()
  13. {
  14.     string state = "HOLD";
  15.     int X_pos = 0;
  16.     // game loop
  17.     while (1) {
  18.         int SX;
  19.         int SY;
  20.         cin >> SX >> SY; cin.ignore();
  21.         for (int i = 0; i < 8; i++)
  22.         {
  23.             int MH; // represents the height of one mountain, from 9 to 0. Mountain heights are provided from left to right.
  24.             cin >> MH; cin.ignore();
  25.             //seuil = MH;
  26.             if ( MH > 0)
  27.             {
  28.             state = "FIRE";
  29.             X_pos = SX;
  30.             }
  31.             cout << state << endl;
  32.             state = "HOLD";
  33.             //if (X_pos == i)
  34.             //{
  35.             //state = "FIRE";
  36.            // }
  37.         }
  38.        
  39.         // Write an action using cout. DON'T FORGET THE "<< endl"
  40.         // To debug: cerr << "Debug messages..." << endl;
  41.         //cout << state << endl; // either:  FIRE (ship is firing its phase cannons) or HOLD (ship is not firing).
  42.        
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement