正在加载图片...
34循环的中断 34.1beak语句 例 include <iostream.h> #include <conio.h> It maino while(1) cout <<"This loop will ran forever, until you hit a keyn if(kbhito) break: cout <<InLoop is over n 程序中的 koito是C++ return O 语言的一个标准函数。3.4 循环的中断 3.4.1 break 语句 例: #include <iostream.h> #include <conio.h> int main() { while(1) { cout << "This loop will ran forever, until you hit a key\n"; if(kbhit()) break; } cout << "\nLoop is over.\n"; return 0; } 程序中的 kbhit() 是 C++ 语言的一个标准函数
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有