Advertisement
Guest User

недокод

a guest
Apr 29th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>;
  2. #include <Algorithms>;
  3. #include <math>;
  4. //#include <iomanip> ;
  5. #include <ifstream>;
  6. #include <ofstream>;
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12. ofstream fo;
  13. fo.open("output.txt");
  14. ifstream fi;
  15. fi.open("input.txt");
  16. int n, m, b, c, y, x, maxc=-1;
  17. int a[200000];
  18. fin>>n>>m;
  19.  
  20. for ( i = 1; i < n; i++ )
  21. {
  22. fin>>a[i];
  23. if (a[i] > maxc)
  24. maxc = a[i];
  25.  
  26.  
  27. }
  28.  
  29. for ( i = 1; i < n; i++ )
  30. {
  31. if (a[i]>=(maxc-m))then
  32. fout<<i<<' ';
  33.  
  34. }
  35.  
  36. fout.close();
  37. return 0;
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement