初看题没想到直接取整,所以用了floor()和ceil()
#include <iostream> #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; }
只得了60分,但总觉得也没问题,求助大佬问题出在哪儿qwq