fork download
  1. # include <iostream>
  2. # include <iomanip>
  3.  
  4. using std::cin;
  5. using std::cout;
  6. using std::endl;
  7.  
  8.  
  9. int Selection;
  10.  
  11. int main()
  12. {
  13.  
  14.  
  15. cout << "##########################################################" << endl;
  16. cout << "# #" << endl;
  17. cout << "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #" << endl;
  18. cout << "# ~~~~ Welcome to the Simple Game ~~~ #" << endl;
  19. cout << "# #" << endl;
  20. cout << "# #" << endl;
  21. cout << "# Please select one of the following options: #" << endl;
  22. cout << "# 1. Play #" << endl;
  23. cout << "# 2. Help #" << endl;
  24. cout << "# 3. Options #" << endl;
  25. cout << "# 4. Quit #" << endl;
  26. cout << "# #" << endl;
  27. cout << "# #" << endl;
  28. cout << "##########################################################" << endl;
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. do
  39. {
  40. cin >> Selection;
  41.  
  42.  
  43. if ( Selection == 1)
  44. {cout << "Playing Game" << endl;
  45. }
  46.  
  47. if ( Selection == 2)
  48. {cout << "In Help Menu" << endl;
  49. }
  50.  
  51. if(Selection == 3)
  52. {cout << "In Option Menu" << endl;
  53. }
  54.  
  55. if (Selection >= 5)
  56. {cout << "Please input a number 1 - 4" << endl;}
  57.  
  58. else
  59.  
  60. if (cin.fail())
  61. {
  62. cout << "Character Error " << endl;
  63. return 0();
  64.  
  65. }
  66.  
  67.  
  68. }
  69. while (Selection != 4);
  70.  
  71. if(Selection == 4)
  72. {cout << "Goodbye!" << endl;}
  73.  
  74.  
  75.  
  76. return 0;
  77. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:63:11: error: expression cannot be used as a function
  return 0();
           ^
stdout
Standard output is empty