how to exit nested loops

后端 未结 6 1230
予麋鹿
予麋鹿 2021-01-21 20:11

i have something like

   while(playAgain==true)
   {
      cout<<\"new game\"<

        
6条回答
  •  野性不改
    2021-01-21 20:33

    If you don't have to avoid goto statement, you can write

    while (a) {
        while (b) {
            if (c) {
                goto LABEL;
            }
        }
    }
    LABEL:
    

提交回复
热议问题