Advertisement
pdpd123

Problem 19

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