Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
112790 余厚泽 12奇数和与偶数和 C++ Accepted 1 MS 276 KB 212 2025-03-12 19:34:21

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int m,n,a=0,b=0; cin>>m>>n; for(int i=m;i<=n;i++) { if(i%2==0) { a=a+i; } else b=b+i; } cout<<a<<" "<<b; return 0; }