北大ACM试题1005 急!!!!!! 20
下面是我的代码,错在何处?我在visualc++6.0上成功了,可是......#include<stdio.h>intmain(){inttimes,n,i;doubl...
下面是我的代码,错在何处? 我在visualc++6.0上成功了,可是......
#include<stdio.h>
int main()
{
int times,n,i;
double x,y;
scanf("%d",×);
for(i=0;i<=times-1;i++)
{
scanf("%lf %lf",&x,&y);
n=1;
while((100*n/3.1415926)<(x*x+y*y))
n=n+1;
printf("Property %d: This property will begin enroding in year %d.\n",i+1,n);
}
printf("END OF OUTPUT.\n");
return 0;
}
程序第6行是
scanf("%d",与times);
复制时有错误 与号打不上 展开
#include<stdio.h>
int main()
{
int times,n,i;
double x,y;
scanf("%d",×);
for(i=0;i<=times-1;i++)
{
scanf("%lf %lf",&x,&y);
n=1;
while((100*n/3.1415926)<(x*x+y*y))
n=n+1;
printf("Property %d: This property will begin enroding in year %d.\n",i+1,n);
}
printf("END OF OUTPUT.\n");
return 0;
}
程序第6行是
scanf("%d",与times);
复制时有错误 与号打不上 展开
4个回答
展开全部
展开全部
#include<stdio.h>
int main()
{
int times,n,i;
double x,y;
scanf("%d",x);
for(i=0;i<=times-1;i++)
{
scanf("%lf %lf",&x,&y);
n=1;
while((100*n/3.1415926)<(x*x+y*y))
n=n+1;
printf("Property %d: This property will begin enroding in year %d.\n",i+1,n);
}
printf("END OF OUTPUT.\n");
return 0;
}
int main()
{
int times,n,i;
double x,y;
scanf("%d",x);
for(i=0;i<=times-1;i++)
{
scanf("%lf %lf",&x,&y);
n=1;
while((100*n/3.1415926)<(x*x+y*y))
n=n+1;
printf("Property %d: This property will begin enroding in year %d.\n",i+1,n);
}
printf("END OF OUTPUT.\n");
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
scanf("%d",×); --- scanf("%f",&x); x是小写,C语言是有大小写之分的.
for(i=0;i<=times-1;i++) times 没初始值.
for(i=0;i<=times-1;i++) times 没初始值.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
scanf("%d",×); ???
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询