作者在 2014-07-03 20:35:51 发布以下内容
#include<iostream>
int main()
{
std::cout<<"Enter two number:"<<std::endl;
int v1,v2;
std::cin>>v1>>v2;
int lower,upper;
if(v1<=v2)
{
lower=v1;
upper=v2;
}
else
{
lower=v2;
upper=v1;
}
std::cout<<"Values of "<<lower<<"to "<<upper<<"inclusive are:"<<std::endl;
for(int val=lower,count=1;val<=upper;++val,++count)
{
std::cout<<val<<" ";
if(count%10==0)//一行输出十个数
std::cout<<std::endl;
}
return 0;
}