题解 | #求 1 - n 之间偶数的和#
求 1 - n 之间偶数的和
http://www.nowcoder.com/practice/03df7fa0950046a9ba564b4438f918a3
#include <iostream>
using namespace std;
int main() {
int n,sum=0;
cin>>n;
if(n%2==1)
n--;
sum=(n/2)*(n/2+1);
cout<<sum;
return 0;
}