Advertisement
Josif_tepe

Untitled

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