#include <math.h>
#include <stdio.h>
int NaturalCheck(double num)
{
double integral = 0.0f;
double fractional = 0.0f;
fractional
= modf(num
, &integral
);
if ((num >= 0) && (fractional == 0.0))
{
return 1;
}
else
{
return -1;
}
}
int main()
{
double num;
printf("%d\n", NaturalCheck
(num
));
return 0;
}
I2luY2x1ZGUgPG1hdGguaD4KI2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgTmF0dXJhbENoZWNrKGRvdWJsZSBudW0pCnsKCWRvdWJsZSBpbnRlZ3JhbCA9IDAuMGY7Cglkb3VibGUgZnJhY3Rpb25hbCA9IDAuMGY7CgoJcHJpbnRmKCIlbGZcbiIsIG51bSk7CgoJZnJhY3Rpb25hbCA9IG1vZGYobnVtLCAmaW50ZWdyYWwpOwoKCWlmICgobnVtID49IDApICYmIChmcmFjdGlvbmFsID09IDAuMCkpCgl7CgkJcmV0dXJuIDE7Cgl9CgllbHNlCgl7CgkJcmV0dXJuIC0xOwoJfQp9CgppbnQgbWFpbigpCnsKCWRvdWJsZSBudW07CgoJc2NhbmYoIiVsZiIsICZudW0pOwoJCglwcmludGYoIiVkXG4iLCBOYXR1cmFsQ2hlY2sobnVtKSk7CgoJcmV0dXJuIDA7Cn0=