80分求助
查看原帖
80分求助
935889
wangqicheng1637楼主2024/1/28 18:49

各位大佬来帮帮我,帮我看看为什么是80分

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
double x;
int y;
int main()
{
	cin >> x;
	if ( x > 0 )
	{
        y = floor(x);
	}
	else if ( x < 0 )
	{
	    y = ceil(x);
	}
    cout << y;
	return 0;
}
2024/1/28 18:49
加载中...