Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
96788 | 夏梓瑞 | 函数求和 | C++ | Accepted | 0 MS | 264 KB | 591 | 2024-11-09 14:37:40 |
#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 q(int x,int j,int e){ for(int w=x;w<=j;w++){ e+=w; } return e; } int main(){ int a=1,b=10,sum=0; cout<<q(a,b,sum); a=20; b=30; sum=0; cout<<' '; cout<<q(a,b,sum); a=35; b=45; sum=0; cout<<' '; cout<<q(a,b,sum); return 0; }