📄 forempty.cpp
字号:
//Listing 6.11 illustrating
//empty for loop statement
#include <iostream>
int main()
{
int counter=0; // initialization
int max;
std::cout << "How many hellos?";
std::cin >> max;
for (;;) // a for loop that doesn't end
{
if (counter < max) // test
{
std::cout << "Hello!\n";
counter++; // increment
}
else
break;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -