Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language error, help me find it. Why do I enter a decimal and the output is not "Please enter an integer" but "Please enter a positive integer"?
C language error, help me find it. Why do I enter a decimal and the output is not "Please enter an integer" but "Please enter a positive integer"?
Your definitions of a, b and c are all integers, and x, y and z are all double precision. X=a-(int)a, this sentence is wrong. (int) A is cast to an integer, and A is an integer. The result of subtracting an integer from an integer is still an integer, which is different from the definition of X.

Double a, b, c;

Double x, y, z;

Scanf("%f, %f, %f ",& one, & c);

x =(int)a-a;

y =(int)b-b;

z =(int)c-c;

Just change it to this.