Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:这就是我对你程序的理解,努力加油呀!---slience

Posted by cuiwj871128 at 2008-11-09 10:00:05 on Problem 1005
In Reply To:这就是我对你程序的理解,努力加油呀!---slience Posted by:slience at 2006-04-02 12:29:22
> //你对题目的理解有错,不是你每次输入一个坐标,就打印出结果的
> //第二你没有对其判断就进行加一的操作,如果它恰好被除断,也就是说它的模为0,此时就不能加一了
> //第三你没有对输入的t进行判断,如果输入为负数,那该怎么办
> //第四你没有对Y值进行判断,它不能是负数。
> //这个是我用C写的,对你应该有帮助!
> #include <stdio.h>
> #include<math.h>
> //1005
> int main()
> {
> 	int m,i;
>     int n[10]={0};
> 	float x,y;
> 	double area;
> 	do
> 	scanf("%d",&m);
> 	while(m<=0);
> 	for(i=0;i<m;i++)
> 	{
> 		scanf("%f%f",&x,&y);
> 		if(y>=0)
> 		{
> 		area=3.14*(x*x+y*y);
>              area=area/100;
> 	    n[i]=(int)area;
> 	    if(area>n[i])
> 		n[i]=n[i]+1;
> 		}
> 	}
> 	for(i=0;i<m;i++)
> 		if(n[i]!=0)
> 		printf("Property %d: This property will begin eroding in year %d.\n",i+1,n[i]);
>     printf("END OF OUTPUT.\n");
> 	return 0;
> }
我感觉不要你那样判断也行,直接输入就可以了

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator