Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a = 0;
- int b = 0;
- int c = 0;
- int d = 1;
- int min = 0;
- cin >> a;
- if (a == 0) {
- cout << "Koniec";
- return 0;
- }
- cin >> b;
- if (b == 0) {
- cout << "Koniec";
- return 0;
- }
- cin >> c;
- if (c == 0) {
- cout << "Koniec";
- return 0;
- }
- cout << "a = " << a << endl;
- cout << "b = " << b << endl;
- cout << "c = " << c << endl;
- while (d != 0){
- cin >> d;
- if (a <= b) min = a;
- if (b < min) min = b;
- if (c < min) min = c;
- cout << "min w petli" << min << endl;
- if ((d > a && d > b && d > c) && (d != a && d != b && d != c)){
- if (min == a) a = d;
- if (min == b) b = d;
- if (min == c) c = d;
- }
- }
- cout << min << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement