Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c;
- cin>>a>>b>>c;
- if(a+b==c){cout<<a<<"+"<<b<<"="<<c<<endl;// 1+
- }else if(a-b==c){cout<<a<<"-"<<b<<"="<<c<<endl;// 1-
- }else if(a*b==c){cout<<a<<"*"<<b<<"="<<c<<endl;// 1*
- }else if(a/b==c){cout<<c<<"="<<a<<"/"<<b<<endl;// 1/
- }else if(c+b==a){cout<<c<<"+"<<b<<"="<<a<<endl;// 1+
- }else if(c-b==a){cout<<c<<"-"<<b<<"="<<a<<endl;// 1-
- }else if(c*b==a){cout<<c<<"*"<<b<<"="<<a<<endl;// 1*
- }else if(c/b==a){cout<<a<<"="<<c<<"/"<<b<<endl;// 1/
- }
- return 0;
- }
- rss feed for new problems
Advertisement
Add Comment
Please, Sign In to add comment