spacerose

1.2.4 доделать

Mar 10th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. class Student {
  4. public:
  5.     void oprt(int x, char z,int y) {
  6.         if (z=='/') x=x/y;
  7.         if (z=='*') x = x * y;
  8.         if (z=='-') x=x-y;
  9.         if (z=='+') x=x+y;
  10.     }
  11. };
  12. int main()
  13. {
  14.     Student abc;
  15.     int x1, p,k=0;
  16.     char ch1;
  17.     cin >> p;
  18.     while (k < 3) {
  19.         cin >> ch1 >> x1;
  20.         abc.oprt(p, ch1, x1);
  21.         k++;
  22.     }
  23.     cout <<p;
  24. }
Add Comment
Please, Sign In to add comment