Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int min;
- int min_position;
- int max;
- int max_position;
- int liczba;
- min = 0;
- max = 0;
- int i = 1;
- while (cin >> liczba)
- {
- if (liczba < min) {
- min = liczba;
- min_position = i;
- }
- if (liczba >= max) {
- max = liczba;
- max_position = i;
- }
- i++;
- }
- cout << min << endl;
- cout << min_position << endl;
- cout << max << endl;
- cout << max_position << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement