21天学通c++之7.5 while 循环

#include <iostream>
using namespace std;
int main()
{
 int counter=0;
 while(true)   //条件永远为true,风格不好
 {
 counter++;
   if(counter>10)
  break;
 }
 cout<<"counter: "<<counter<<endl;
 return 0;
}
posted @ 2008-11-22 15:08  雨城  阅读(276)  评论(0编辑  收藏  举报