Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
97607 王思颜 函数求和 C++ Accepted 0 MS 260 KB 251 2024-11-16 11:32:28

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int he(int a,int b){ int ans = 0; for (int i = a;i <= b;i++){ ans += i; } return ans; } int main(){ cout<<he(1,10)<<endl; cout<<he(20,30)<<endl; cout<<he(35,45)<<endl; return 0; }