题目描述
题目中等,注意输出格式即可。
样例
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int m, n, sum;
cin >> m >> n;
while ( m > 0 && n > 0 ) {
sum = 0;
if ( m > n ) swap(m, n);
for ( int i = m; i <= n; i ++ ) {
cout << i << " ";
sum += i;
}
cout << "Sum=" << sum <<endl;
cin >> m >> n;
}
return 0;
}