Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- using namespace std;
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- int main()
- {
- string state = "HOLD";
- int X_pos = 0;
- // game loop
- while (1) {
- int SX;
- int SY;
- cin >> SX >> SY; cin.ignore();
- for (int i = 0; i < 8; i++)
- {
- int MH; // represents the height of one mountain, from 9 to 0. Mountain heights are provided from left to right.
- cin >> MH; cin.ignore();
- //seuil = MH;
- if ( MH > 0)
- {
- state = "FIRE";
- X_pos = SX;
- }
- cout << state << endl;
- state = "HOLD";
- //if (X_pos == i)
- //{
- //state = "FIRE";
- // }
- }
- // Write an action using cout. DON'T FORGET THE "<< endl"
- // To debug: cerr << "Debug messages..." << endl;
- //cout << state << endl; // either: FIRE (ship is firing its phase cannons) or HOLD (ship is not firing).
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement