新手使用win-tc时,遇到一个问题,求解???
/* Program 2.8 calculations on a table */#include <stdio.h>
int main(void)
{
float radius = 0.0f; /*The radius of the table */
float diameter = 0.0f; /*The diameter of the table */
float circumference = 0.0f; /*The circumference of the table */
float area = 0.0f; /*The area of a circle */
float Pi = 3.1415926f;
printf("Input the diameter of the table :6");
scanf("%f",&diameter); /*Read the diameter from the keyboard */
radius = diameter/2.0f; /*Calculate the radius */
circumference = 2.0f*Pi*radius; /*Calculate the circumference */
area = Pi*radius*radius; /*Calculate the area */
printf("\nThe circumference is %,2f",circumference);
printf("\nThe area is %.2f\n",area );
getch();
return 0;
}
我在编译器里面输入如上:
书上说的是应该输出的如下:
Input the diameter of the table:6
The circumference is 18.85
The area is 28.27
但是为什么我出来的只是:
Input the diameter of the table:
初学者小弟在此谢谢大家了,求解