小编use*_*878的帖子

为什么会有无限循环?c ++

do{
    cout << "your number"; cin >> z;


   if (z > 4){
    cout << "invalid answer" << endl;}
   else if (z == 4){
   cout << " no" << endl;}
   else {
   cout  <<"great!"   << endl; }
} while (z != 3, 2, 1);
}
Run Code Online (Sandbox Code Playgroud)

我的意见是:提出"你的号码",直到z为3或2或1?怎么了?'

c++ loops infinite while-loop

0
推荐指数
1
解决办法
124
查看次数

标签 统计

c++ ×1

infinite ×1

loops ×1

while-loop ×1