运行没错啊,你是用的什么编译器
Input the diameter of the table:在这个之后输入数字啊,然后回车
我运行了没错啊
还有你这句话 到scanf前能翻译出后面就不显示了呢????
谁能看懂?
有些IDE在程序结束之后会自动退回到程序编辑界面,你需要进入相应的界面才能够查看运行结果,比如TC里,你需要进入DOS界面看结果(我记得快捷键好像是ALT+F5)。
在程序之后加句
getch() 记得好象是这个吧
反正就是等待接收一个字符输入
试试
#include
int main(void)
{
float radius=0;
float diameter=6;
float circumference=0;
float area=0;
float pi=3.1415926;
printf("Input the diameter of the table: ");
scanf("%f",&diameter);
radius=diameter/2;
circumference=2*radius*pi;
area=pi*radius*radius;
printf("\nThe circumference is %.2f",circumference);
printf("\nThe area is %.2f\n",area);
getch();
return 0;
}
LZ在程序的最后加一个getch()试试。。