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:不懂C++,不多言语了

Posted by BaoHonglin at 2006-05-18 00:14:12 on Problem 1005
In Reply To:不懂C++,不多言语了 Posted by:oeym at 2006-03-07 20:54:33
那就贴个C语言的,供参考:
#include<stdio.h>
#define PI 3.1415926
int main()
{
	int i,n,s;
	float x,y,v;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%f%f",&x,&y);
		v=(PI*(x*x+y*y)/2)/50;
		s=v;
		if(v==s)
		    printf("Property %d: This property will begin eroding in year %d.\n",i+1,s);
		if(v>s)
			printf("Property %d: This property will begin eroding in year %d.\n",i+1,s+1);
		if(i==n-1)
		    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