Because there are only three situations, three judgments are enough;
The code is as follows:
Floating x;
float y = 0.0
int k;
Printf ("Please enter a