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

高手指点 哪里错了?

Posted by harryyang at 2007-08-20 12:05:08 on Problem 1005
#include<stdio.h>
#include<math.h>
#include<memory.h>
#define PI 3.14159265
void main(){
	int totalSets,i,n;float *x,*y,distanceSquare;
	fscanf(stdin,"%d",&totalSets);
         getc(stdin);
	x=(float *)malloc(totalSets+1);
	y=(float *)malloc(totalSets+1);
	for(i=1;i<=totalSets;i++){
		fscanf(stdin,"%f %f",&x[i],&y[i]);
                  getc(stdin);
	}
	for(i=1;i<=totalSets;i++){
		distanceSquare=x[i]*x[i]+y[i]*y[i];
		n=ceil(PI*distanceSquare/100);
		fprintf(stdout,"Property %d: This property will begin eroding in year %d.\n",i,n);
	}
         fprintf(stdout,"END OF OUTPUT.\n");
}

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