Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int a = 0;
  6.     int b = 0;
  7.     int c = 0;
  8.     int d = 1;
  9.     int min = 0;
  10.    
  11.     cin >> a;
  12.         if (a == 0) {
  13.         cout << "Koniec";
  14.         return 0;
  15.         }
  16.     cin >> b;
  17.         if (b == 0) {
  18.         cout << "Koniec";
  19.         return 0;
  20.         }
  21.     cin >> c;
  22.         if (c == 0) {
  23.         cout << "Koniec";
  24.         return 0;
  25.         }
  26.    
  27.     cout << "a = " << a << endl;
  28.     cout << "b = " << b << endl;
  29.     cout << "c = " << c << endl;
  30.    
  31.    
  32.     while (d != 0){
  33.         cin >> d;
  34.        
  35.         if (a <= b) min = a;
  36.         if (b < min) min = b;
  37.         if (c < min) min = c;
  38.        
  39.         cout << "min w petli" << min << endl;
  40.        
  41.         if ((d > a && d > b && d > c) && (d != a && d != b && d != c)){
  42.             if (min == a) a = d;
  43.             if (min == b) b = d;
  44.             if (min == c) c = d;
  45.             }
  46.         }
  47.            
  48.     cout << min << endl;
  49.    
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement