| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 126673 | 就这? | 奇数求和 | C++ | Accepted | 100 | 0 MS | 240 KB | 272 | 2024-01-24 16:54:06 |
#include<bits/stdc++.h> using namespace std; int main(){ int i,s = 0,a,b,c,d; cin>>a>>b; if(a % 2 == 0){ c = a + 1; }else{ c = a; } if(b % 2 == 0){ d = b - 1; }else{ d = b; } for(i = c;i <= d;i+=2){ s = s + i; } cout<<s<<endl; }//F