#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int m,n,sum;
while(1)
{
cin>>m>>n;
if(m>n) swap(m,n);
if(m<=0) break;
sum=0;
for(int i=m;i<=n;i++)
{
sum+=i;
cout<<i<<' ';
}
cout<<"Sum="<<sum;
cout<<endl;
}
}
2
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int m,n,sum;
while(cin>>m>>n,m>0&&n>0)
{
if(m>n) swap(m,n);
sum=0;
for(int i=m;i<=n;i++)
{
sum+=i;
cout<<i<<' ';
}
cout<<"Sum="<<sum;
cout<<endl;
}
}