| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 76546 | 石晋骁 | 13奇数和与偶数和 | C++ | Wrong Answer | 0 MS | 268 KB | 354 | 2024-06-02 15:14:07 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,h,x,m; cin >> n; m = n; if(n%2 == 1){ n = n-1; } x = (n-0)/2+1; h = (0+n)*x/2; cout << h << " "; h =0; x = 0; n = m; if(n%2 == 0){ n = n-1; } x = (n-1)/2+1; h = (1+n)*x/2; cout << h; return 0; }
------Input------
157
------Answer-----
6241 6162
------Your output-----
6162 6241