Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
75678 陈昊然 13奇数和与偶数和 C++ Accepted 1 MS 276 KB 209 2024-05-28 19:00:25

Tests(10/10):


Code:

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