Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
113864 | 罗子童 | 函数求和 | C++ | Accepted | 1 MS | 268 KB | 450 | 2025-03-16 19:05:17 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int sum(int a,int b){ int s=0; for(int i=a;i<=b;i++){ s+=i; } return s; } int main(){ cout<<sum(1,10)<<endl<<sum(20,30)<<endl<<sum(35,45)<<endl; return 0; }