蒟蒻求助
查看原帖
蒟蒻求助
719602
LaoWang168楼主2023/8/30 22:30

初看题没想到直接取整,所以用了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

2023/8/30 22:30
加载中...