fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <math.h>
  4. using namespace std;
  5.  
  6. int min(int A[], int s)
  7. {
  8. int x = A[0];
  9. for (int i = 0; i<s; i++)
  10. if (A[i]<x)
  11. x = A[i];
  12. return x;
  13. }
  14.  
  15. int max(int A[], int s)
  16. {
  17. int x = A[0];
  18. for (int i = 0; i<s; i++)
  19. if (A[i]>x)
  20. x = A[i];
  21. return x;
  22. }
  23.  
  24.  
  25. int main()
  26. {
  27. int Array[10] = { 15,20,8,0,17,14,2,12,10,5 };
  28.  
  29. string UserInput;
  30. cin >> UserInput;
  31.  
  32. if (UserInput == "Minimun")
  33. {
  34. int Minimum = min(Array, 10);
  35. }
  36.  
  37. if (UserInput == "Maximum")
  38. {
  39. int Maximum = max(Array, 10);
  40. }
  41.  
  42. if (UserInput == "Dropped")
  43. {
  44. int count = min(Array, 10) + 1;
  45. for (int i = min(Array, 10); i<max(Array, 10) - 1; i++)
  46. cout << count++ << "\n";
  47. }
  48.  
  49. return 0;
  50. }
Success #stdin #stdout 0s 3460KB
stdin
Dropped
stdout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19