T3000

Untitled

Oct 14th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a,b,c;
  8.     cin>>a>>b>>c;
  9.  
  10.     if(a+b==c){cout<<a<<"+"<<b<<"="<<c<<endl;// 1+
  11.      }else if(a-b==c){cout<<a<<"-"<<b<<"="<<c<<endl;// 1-
  12.      }else if(a*b==c){cout<<a<<"*"<<b<<"="<<c<<endl;// 1*
  13.      }else if(a/b==c){cout<<c<<"="<<a<<"/"<<b<<endl;// 1/
  14.      }else if(c+b==a){cout<<c<<"+"<<b<<"="<<a<<endl;// 1+
  15.      }else if(c-b==a){cout<<c<<"-"<<b<<"="<<a<<endl;// 1-
  16.      }else if(c*b==a){cout<<c<<"*"<<b<<"="<<a<<endl;// 1*
  17.      }else if(c/b==a){cout<<a<<"="<<c<<"/"<<b<<endl;// 1/
  18.      }
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.     return 0;
  30.  
  31.   }
  32.  
  33.  rss feed for new problems
Advertisement
Add Comment
Please, Sign In to add comment