21天学通c++之7.12 空的for循环
#include <iostream>
using namespace std;
int main()
{
int counter=0;
int max;
cout<<"how many hello?";
cin>>max;
for(;;)
{
if(counter<max)
{
cout<<"hello!"<<endl;
counter++;
}
else
break;
}
return 0;
}
using namespace std;
int main()
{
int counter=0;
int max;
cout<<"how many hello?";
cin>>max;
for(;;)
{
if(counter<max)
{
cout<<"hello!"<<endl;
counter++;
}
else
break;
}
return 0;
}