Run ID:162387
提交时间:2026-10-17 14:26:24
#include <bits/stdc++.h> using namespace std; int main () { int n; cin>>n; int s=0; int y = 0; for(int i = 1;i<=n;i++){ if(i%2==1){ s=s+i; } } for(int i = 1;i<=n;i++){ if(i%2==0){ y=y+i; } } cout<<s<<" "<<y; return 0; }