Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
3335 | OscarWLY | 求和 | C++ | Accepted | 0 MS | 244 KB | 156 | 2023-01-01 15:34:54 |
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int ans=0; for(int i=1;i<=n;i+=2) ans+=i; cout<<ans; return 0; }