Advertisement
Josif_tepe

Untitled

Jan 18th, 2024
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 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.    
  9.     char c;
  10.     cin >> c;
  11.      
  12.     if(c == '+') {
  13.         cout << a + b << endl;
  14.     }
  15.     if(c == '-') {
  16.         cout << a - b << endl;
  17.     }
  18.     if(c == '*') {
  19.         cout << a * b << endl;
  20.     }
  21.     if(c == '/') {
  22.         cout << a / b << endl;
  23.     }
  24.    
  25.    
  26.     return 0;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement