这题是真没啥说的
#include<stdio.h>
int main(){
float number ;
scanf("%f", &number);
int num = (int)number;
float remander = number - num;
if(remander >= 0.5){
printf("%d", num+1);
}
else{
printf("%d", num);
}
return 0;
}
这题是真没啥说的
#include<stdio.h>
int main(){
float number ;
scanf("%f", &number);
int num = (int)number;
float remander = number - num;
if(remander >= 0.5){
printf("%d", num+1);
}
else{
printf("%d", num);
}
return 0;
}