InnaSibirova

Условный оператор

Oct 18th, 2019
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int a, b, c;
  5.     cin >> a >> b >> c;
  6.     if(a <= 0 || b <= 0 || c <= 0) {
  7.         cout << "ERROR";
  8.     }
  9.     else if(a + b <= c || a + c <= b || b + c <= a) {
  10.         cout << 0;
  11.     }
  12.    
  13.     else {
  14.    
  15.     if(a == b && a == c && b == c) {
  16.         cout << 3;
  17.     }
  18.     else if(a == b || b == c || a == c) {
  19.         cout << 2;
  20.     }
  21.     else {
  22.         cout << 1;
  23.     }
  24. }
  25. }
RAW Paste Data