B2016 浮点数向零舍入
虽然通过,但还是想问这样为什么不行:
#include <bits/stdc++.h> using namespace std; int main() { double x; cin >> x; if (x>=0) { cout << floor(x); } else { cout << ceil(x); } return 0; }