Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
90501 | 李谨睿 | 12奇数和与偶数和 | C++ | Accepted | 1 MS | 272 KB | 246 | 2024-09-15 13:38:00 |
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,s=0,d=0; cin>>a>>b; for(int i=a;i<=b;i++){ if(i%2==0){ s=s+i; }else{ d=d+i; } } cout<<s<<endl; cout<<d; return 0; }