| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:不懂C++,不多言语了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator