Advertisement
Guest User

Untitled

a guest
May 4th, 2022
18
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 <string>
  3. #include <vector>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. int highestMountain = 0;
  11. int highestMountainIndex = 0;
  12.  
  13. // game loop
  14. while (1) {
  15. for (int i = 0; i < 8; i++) {
  16. int mountain_h; // represents the height of one mountain.
  17. cin >> mountain_h; cin.ignore();
  18. if (mountain_h > highestMountain) {
  19. highestMountain = mountain_h + 1;
  20. highestMountainIndex = i;
  21. }
  22. }
  23. cout << highestMountainIndex << endl;
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement