21天学通c++之7.7 do....while 循环
#include <iostream>
using namespace std;
int main()
{
int counter;
cout<<"how many hello?";
cin>>counter;
do
{
cout<<"hello\n";
counter--;
}while(counter>0);
cout<<"counter is : "<<counter<<endl;
return 0;
}
using namespace std;
int main()
{
int counter;
cout<<"how many hello?";
cin>>counter;
do
{
cout<<"hello\n";
counter--;
}while(counter>0);
cout<<"counter is : "<<counter<<endl;
return 0;
}