// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>

using namespace std;

int main()
{
   int v1, v2;
   char op,cont;
   do {
      cout << "v1 op x = v2" << endl;    
      cout << "Enter v1: ";
      cin >> v1;
      cout << "Enter op (+,-,*,/): ";
      cin >> op;
      cout << "Enter v2: ";
      cin >> v2;
      cout << v1 << op << "x=" << v2 << endl;
      if(op=='+') {
          cout << "x=" << (v2 - v1) << endl;
      } else if(op=='-') {
          cout << "x=" << (v1 - v2) << endl;
      } else if(op=='*') {
          cout << "x=" << (v2 / v1) << endl;
      } else if(op=='/') {
          cout << "x=" << (v1 / v2) << endl;
      }
      cout << "Continue (y,n): ";
      cin >> cont;
   } while(cont=='Y' || cont=='y');
}
