1、
#include <iostream> int main() { int startNum = 0; int endNum = 0; std::cout << "please enter tow num:" << std::endl; std::cin >> startNum; std::cin >> endNum; long long sum = 0; for(int i = startNum; i <= endNum; i++) sum += i; std::cout << "the sum betwen " << startNum << " and " << endNum << "is: " << sum << std::endl; return 0; }
原文地址:https://www.cnblogs.com/f00345709/p/9245795.html
时间: 2024-10-09 23:49:49