转载的老师发的答案,关注我,随时更新答案,如果来不及了,可以私信我,我发给你们相应的答案
#includeusing namespace std; int main() { int counter{1}; bool exit{false}; while (!exit) { std::cout << counter << " "; ++counter; exit = (counter == 5); } cout << endl << "Broke out of loop at count = " << counter << endl; return 0; }
下面是运行结果:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)