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

C++编译就可以,C定义变量放在函数的开始。

Posted by sicojuy at 2010-12-05 20:12:52 on Problem 1005
In Reply To:为什么是compile error,请帮忙看看啊,谢谢啊。 Posted by:wangdi_nenu_cs at 2010-05-09 20:30:10
> 
> #include<stdio.h>
> #define PI 3.14159
> int main(){
> 
> int n;
> int year[100];
> scanf("%d",&n);
> 
> for(int i=0;i<n;i++)
> {
> 
> float x,y;
> scanf("%f %f",&x,&y);
> if(x<0)
> x=-x;
> float s=PI*(x*x+y*y);
> year[i]=(int)s/100+1;
> 
> 
> 
> }
> for( i=0;i<n;i++)
> printf("Property %d: This property will begin eroding in year %d.\n",i+1,year[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