#include<iostream>
int main()
{
using namespace std;
int m,n;
cout << "请输入较小的整数:";
cin >> m;
cout << "请输入较大的整数:";
cin >> n;
int sum = 0;
for(;m <= n;m++){
sum += m;
}
cout << "两个整数之间的和为:" << sum << endl;
return 0;
}
Exercise 5.1
最新推荐文章于 2024-09-14 18:37:46 发布