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;
- int main()
- {
- int highestMountain = 0;
- int highestMountainIndex = 0;
- // game loop
- while (1) {
- for (int i = 0; i < 8; i++) {
- int mountain_h; // represents the height of one mountain.
- cin >> mountain_h; cin.ignore();
- if (mountain_h > highestMountain) {
- highestMountain = mountain_h + 1;
- highestMountainIndex = i;
- }
- }
- cout << highestMountainIndex << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement