题解 | 牛牛学数列
牛牛学数列
https://www.nowcoder.com/practice/0b97367cd2184c12a0e02f7c223aee11
#include <cmath> #include <iostream> using namespace std; int main() { int T; cin>>T; if (T%2==0) { cout<<T/2*(-1); }else { cout<<T/2*(-1)+T; } } // 64 位输出请用 printf("%lld")