寻错误 一道简单的求圆周长和面积的题目
#include <stdio.h>void main()
{
float radius = 0.0f;
float diameter = 0.0f;
float circumference = 0.0f;
float area = 0.0f;
float pi = 3.14159265f;
printf("input the diameter of the table:6");
scanf("%f",&diameter);
radius = diameter/2.0f;
circumference = pi*radius*2.0f;
area = pi*radius*radius;
printf("\nthe circumference is %.2f",circumference);
printf("\nthe area is %.2f`\n",area );
getch();
}
为什么我最后输出的结果只有“input the diameter of the table:6”
而不能计算出面积和周长,我检查了几遍貌似没错啊!求教!!!!!