标签:整数 end class tmp iostream std out while str
//打印两个整数指定范围的所有整数
#include<iostream>
int main()
{
int sum=0;
int a=0,b=0;
std::cout<<"请输入两个整数:"<<std::endl;
std::cin>>a>>b;
int tmp=a;
if(a>=b)
{
while(tmp>=b)
{
std::cout<<tmp<<std::endl;
--tmp;
}
}else
{
while(tmp<=b)
{
std::cout<<tmp<<std::endl;
++tmp;
}
}
return 0;
}
标签:整数 end class tmp iostream std out while str
原文地址:https://www.cnblogs.com/angury/p/13365514.html