Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
142002 徐康浩 12奇数和与偶数和 C++ Accepted 1 MS 272 KB 198 2025-12-29 17:00:33

Tests(10/10):


Code:

#include<iostream> using namespace std; int main(){ int a,b,c,d; c=0; d=0; cin>>a>>b; for(int x=a;x<=b;x++){ if(x%2==1){ c=c+x; }else{ d=d+x; } } cout<<d<<" "<<c; }