Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>>
- using namespace std;
- int main()
- {
- int max1 = 0, max2 = 0, n, x;
- cout << "cate nr se citesc??"; cin >> n;
- for (int i = 1; i<= n; i++)
- {
- cout << "introdu nr:"; cin >> x;
- if (x > max1)
- max1 = x;
- if (max1 > max2)
- swap(max1, max2);
- }
- cout << max1 << endl << max2 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement