Advertisement
HyperSensualNarwhal

beginner. exercise #10

Nov 28th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. /*
  2. Увеличение переменных с оператором if
  3. */
  4.  
  5. #include <iostream>
  6.  
  7. using std::cout;
  8. using std::cin;
  9. using std::endl;
  10.  
  11. void main()
  12. {
  13.     setlocale(LC_ALL, "Russian");
  14.  
  15.     int a, b, c;
  16.  
  17.     cout << "Введите первое число: "; cin >> a;
  18.     cout << "Введите второе число: "; cin >> b;
  19.     cout << "Введите третье число: "; cin >> c;
  20.  
  21.     if (a == b || a == c || b == c)
  22.     {
  23.         a += 5;
  24.         b += 5;
  25.         c += 5;
  26.         cout << "a = " << a << "\nb = " << b << "\nc = " << c << endl;
  27.     }
  28.     else
  29.         cout << "Равных нет " << endl;
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement