Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x, y, i = 2, min, max;
- cout << "So thu 1 = ";
- cin >> x;
- min = x; max = x;
- while (!cin.fail())
- {
- cout << "So thu " << i << " = ";
- cin >> y;
- if (y)
- {
- if (y > max) max = y;
- if (y < min) min = y;
- }
- x = y;
- i++;
- }
- cout << "So lon nhat = " << max;
- cout << "\nSo be nhat = " << min;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement