Advertisement
Josif_tepe

Untitled

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