#include <iostream>
using namespace std;
signed main() {
int s = 0;
for (int i = 99; i >= 1; i--) {
if ((i & 1) == 0)
s -= i;
else
s += i;
}
cout << s;
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
signed main() {
int s = 0;
for (int i = 99; i >= 1; i--) {
if ((i & 1) == 0)
s -= i;
else
s += i;
}
cout << s;
return 0;
}