cin >> N; Flag = -1; tnt = 0; for (i = 1; i < N + 1; i++) { Flag = -Flag; tnt += Flag * i; } cout << tnt;
正确
错误