Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
116943 | 晏莞煜 | 12奇数和与偶数和 | C++ | Accepted | 1 MS | 272 KB | 256 | 2025-04-12 19:37:52 |
#include <iostream> using namespace std; int main(){ int m,n,q=0,w=0; cin>>m>>n; for(int a=m;a<=n and a>=m;a++){ if(a%2==0){ q+=a; }else{ w+=a; } } cout<<q<<" "<<w; return 0; }