Untitled
unknown
plain_text
2 years ago
153 B
4
Indexable
#include <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
if (n % 2 == 0) cout << n / 2;
else cout << -(n / 2 + 1);
}
Editor is loading...
Leave a Comment
#include <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
if (n % 2 == 0) cout << n / 2;
else cout << -(n / 2 + 1);
}