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;
}
posted @ 2008-11-22 17:19  雨城  阅读(223)  评论(0编辑  收藏  举报