Advertisement
Guest User

Untitled

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