fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int k;
  6. float x;
  7. float c,d,e,f;
  8. cout << "x= ";
  9. cin >> x;
  10. cout << "k= ";
  11. cin >> k;
  12. switch (k)
  13. {
  14. case 3:
  15. case 6:
  16. case 11:
  17. c=2*x+5;
  18. cout <<2<<"*"<<x<<"+"<<5<<"="<<c<<endl;
  19. break;
  20. case 9:
  21. case 10:
  22. d=10-x;
  23. cout <<10<<"-"<<x<<"="<<d<<endl;
  24. break;
  25. case 13:
  26. e=3*x;
  27. cout <<3<<"*"<<x<<"="<<e<<endl;
  28. break;
  29.  
  30. default :
  31. f=12*x;
  32. cout <<12<<"*"<<x<<"="<<f<<endl;
  33. break;
  34. }
  35. cin.get();
  36. return 0;
  37. }
Success #stdin #stdout 0s 3432KB
stdin
5
14
stdout
x= k= 12*5=60