求解释!!!求球的体积出了问题
# include <stdio.h>int main()
{int r;
printf("请输入r的值\n");
scanf("%d",&r);
printf("%ld",3.14*r*r*r);
return 0;
}
输入r=1,居然输出1374389535
为什么
# include <stdio.h> int main() { int r; printf("请输入r的值\n"); scanf("%d",&r); printf("square = %ld\n",(long)3.14*r*r*r); return 0; }