Advertisement
Guest User

ex14

a guest
Dec 14th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ifstream f("numere.txt");
  5. int main()
  6. {
  7. int n, min1 = 100, min2 = 100, i, a, b,ok=0;
  8. f >> n;
  9. for (i = 0, i < n;i++;)
  10. {
  11. f >> a >> b;
  12. while (a < 100 && b < 100 && a<b)
  13. {
  14. ok=1;
  15. if(ok==0)
  16. {
  17. cout<<"0";
  18. }
  19. if (a < min1)
  20. {
  21. min1 = a;
  22. min2 = b;
  23. }
  24. }
  25. }
  26. if (min1 < min2)
  27. {
  28. cout << min1 << " " << min2;
  29. else
  30. cout << min2 << min1;
  31. }
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement