Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160292 吴尔玉 12奇数和与偶数和 C++ Accepted 1 MS 272 KB 212 2026-09-13 20:27:34

Tests(10/10):


Code:

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