#include<iostream>
using namespace std;
int main()
{
int N,M,SUM=0;
while(1)
{
cin>>M;
cin>>N;
if(M<=0 || N<=0)
{
return 0;
}
if(M>N)
{
swap(M,N);
}
for(int i=M;i<=N;i++)
{
cout<<i<<" ";
SUM+=i;
}
cout<<"Sum="<<SUM<<endl;
SUM=0;
}
return 0;
}
Add your comment