Advertisement
Guest User

Untitled

a guest
May 25th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 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 Montagne[7];
  11. int Max = 0;
  12. int Position = 0;
  13.  
  14. while (1) {
  15. int SX;
  16. int SY;
  17. cin >> SX >> SY; cin.ignore();
  18. for (int i = 0; i < 8; i++)
  19. {
  20. int MH;
  21. cin >> MH; cin.ignore();
  22.  
  23. if (MH > Max) // Determine l'emplacement le plus haut
  24. {
  25. Max = MH; // Valeur la plus grande
  26. Position = i; // Emplacement de la montagne la plus haute
  27. }
  28. Montagne[i] = MH;
  29. }
  30.  
  31. for (int j=0; j<8;j++)
  32. {
  33. cerr << Position << "|" << SX << endl;
  34. if (SX == Position) // Le vaisseau tire quand il se trouve au dessus de la montagne la plus haute
  35. {
  36. cout << "Pourquoi tu tires pas idiot?" << endl;
  37. cerr << "TIRE!!!" << endl;
  38. }
  39. else
  40. {
  41. cout << "HOLD" << endl;
  42. }
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement