什么同样的代码在VC6.0可以运行出结果,而在VS2015上运行不出来的啊
#include<stdio.h>intmain(void){floatradius=0.0f;//Theradiusofthetablefloatdiameter=0....
#include<stdio.h>
int main(void)
{
float radius=0.0f; //The radius of the table
float diameter=0.0f; //The dimeter of the table
float circumference=0.0f; //The circumference of the table
float area=0.0f; //The area of the table
float Pi=3.14159265f;
printf("Input the dimater of the table:0.6E1f",diameter); //read the diameter from the keyboard
scanf("%f", &diameter);
radius=diameter/2.0f; //calculate the radius
circumference = 2.0f*Pi*radius; //calculate the ciecumference
area = Pi*radius*radius; //calculate the area
printf("\nThe area of the table is %.2f",area);
printf("\nThe cirmusference of the table is %.2f", circumference);
return 0;
} 展开
int main(void)
{
float radius=0.0f; //The radius of the table
float diameter=0.0f; //The dimeter of the table
float circumference=0.0f; //The circumference of the table
float area=0.0f; //The area of the table
float Pi=3.14159265f;
printf("Input the dimater of the table:0.6E1f",diameter); //read the diameter from the keyboard
scanf("%f", &diameter);
radius=diameter/2.0f; //calculate the radius
circumference = 2.0f*Pi*radius; //calculate the ciecumference
area = Pi*radius*radius; //calculate the area
printf("\nThe area of the table is %.2f",area);
printf("\nThe cirmusference of the table is %.2f", circumference);
return 0;
} 展开
1个回答
2016-06-18
展开全部
#define BUFSIZE 100
char buf[BUFSIZE]; /* buffer for ungetch */
int bufp = 0; /* next free position in buf */
int getch(void) /* get a (possibly pushed-back) character */
{
return (bufp > 0) ? buf[--bufp] : getchar();
}
void ungetch(int c) /* push character back on input */
{
if (bufp >= BUFSIZE)
printf("ungetch: too many characters\n");
else
buf[bufp++] = c;
}
char buf[BUFSIZE]; /* buffer for ungetch */
int bufp = 0; /* next free position in buf */
int getch(void) /* get a (possibly pushed-back) character */
{
return (bufp > 0) ? buf[--bufp] : getchar();
}
void ungetch(int c) /* push character back on input */
{
if (bufp >= BUFSIZE)
printf("ungetch: too many characters\n");
else
buf[bufp++] = c;
}
追问
不要意思 大神 这个我现在 看不懂 但还是要谢谢你 这个我先放一下 我把这一张看完可 应该可以理解 谢谢
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询