Advertisement
chevengur

Вводный курс: основы C++ | Урок 4: Логические операции: сравнение 3/3

Aug 22nd, 2023 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main() {
  4.     double a, b;
  5.     std::cin >> a >> b;
  6.     if (a == b) {
  7.         std::cout << "The orange is divided into two equal parts";
  8.     }
  9.     else if (a > b) {
  10.         std::cout << "Cut off " << a - b << " from the first part";
  11.     }
  12.     else
  13.         std::cout << "Cut off " << b - a << " from the second part";
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement