int flag = 0; //Mark with a sign
Floating I; //float is used here because the user can enter a decimal.
Do {
scanf("%f ",I);
If (me! =(int)i) {// Perform forced type conversion on i to determine whether the number converted into an integer is equal to the value of i..
Printf ("The number you entered is not an integer! Please re-enter! "
flag = 0; //If the input is not an integer, set the flag to 0.
}while(! Flag); //judges! Whether the flag is true or not, if so, continue to execute the loop.