C++程序设计基础(精品·公开课件).pptVIP

  • 2
  • 0
  • 约2.06万字
  • 约 97页
  • 2018-11-05 发布于广西
  • 举报
#include iostream using namespace std; enum game_result {WIN, LOSE, TIE, CANCEL}; int main() { game_result result; game_result omit = CANCEL; int count; for (count = WIN ; count = CANCEL ; count++) { result = (game_result)count; if (result == omit) { cout The game was cancelled\n; } else { cout The game was played ; if (result == WIN) cout and we won!; if (result == LOSE) cout and we lost.; cout \n; } } return 0; } * 运行结果: The game was played and we won! The game was played and we lost. The game

文档评论(0)

1亿VIP精品文档

相关文档