Advertisement
Guest User

Mano tevas

a guest
Nov 28th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int n;
  9. int Kaina[200];
  10. ifstream fi("aukcionas-jau.in");
  11. fi >> n;
  12. for(int i=0; i<n; i++)
  13. fi >> Kaina[i];
  14. fi.close();
  15. int temp=0;
  16. int score=0;
  17. for(int j=0; j<n; j++)
  18. {
  19. if(temp > Kaina[j]){
  20. score++;
  21. temp = 0;}
  22. if(temp < Kaina[j])
  23. temp = Kaina[j];
  24. }
  25. score++;
  26. ofstream fo("aukcionas-jau.out");
  27. fo << score << endl;
  28. fo.close();
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement