【发布时间】:2011-03-07 02:47:46
【问题描述】:
我正在学习 C 并且我有以下代码:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char *argv[])
{
double x;
printf("x = ");
scanf("%ld", &x);
printf("x = %lf\n", x);
system("PAUSE");
return 0;
}
(我使用的是 Dev C4.9,Windows XP SP3)
当我运行上述程序并进入 5.3;程序打印x = 0.000000
谁能解释一下这是为什么?
非常感谢。
【问题讨论】: