IDNLearn.com offers a comprehensive platform for finding and sharing knowledge. Our platform is designed to provide quick and accurate answers to any questions you may have.
#include
using namespace std;
int main () {
long long n;
cin >> n;
long long sum=0;
for(long long i=1; i<=n; i++){
if(i%2==0){
{sum+=i;}
if(i%2!=0){
sum-=i;
}
}
}
cout << sum << endl;
return 0;
}
Sagot :
We are happy to have you as part of our community. Keep asking, answering, and sharing your insights. Together, we can create a valuable knowledge resource. Find precise solutions at IDNLearn.com. Thank you for trusting us with your queries, and we hope to see you again.