21天学通c++之7.3---while 循环

#include <iostream>
using namespace std;
int main()

{
 unsigned short small;
 unsigned long large;
 const unsigned short MAXSMALL=65535;

  cout<<"enter a small number ";

  cin>>small;
  

  cout<<"enter a large number ";

  cin>>large;

 

cout<<"small: "<<small<<"...";
 

  while(small<large&&small<MAXSMALL)

  {
   if(small%5000==0)

   {cout<<".";};
   small++;
   large-=2;
  }
 cout<<"\nsmall: "<<small<<"\nlarge: "<<large<<endl;
 return 0;
}

posted @ 2008-11-21 12:07  雨城  阅读(315)  评论(0编辑  收藏  举报