Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
119207 刘益梵 12奇数和与偶数和 C++ Accepted 1 MS 272 KB 225 2025-05-17 10:41:01

Tests(10/10):


Code:

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