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 Yogurt89 at 2010-07-28 02:41:43 on Problem 1005
#include<stdio.h>{
#define PI 3.1415926;
 main()
{
    int sum;
    int year(float a,float b);
    struct house
    {
        float x;
        float y;
        int time;
    }h[100];
    scanf("%d",&sum);
    int i=0;
    for(;i<sum;i++)
    {
        scanf("%f %f",&h[i].x,&h[i].y);
        h[i].time=year(h[i].x,h[i].y);
    }
    i=0;;
    for(;i<sum;i++)
    {
        printf("Property %d: This property will begin eroding in year %d.\n",i+1,h[i].time);
    }
    printf("END OF OUTPUT.\n");
}
int year(float a,float b)
{   double r=0;
    int n=0;
    int temp=100;
    double te;
    while(r<=a||r<=b)
    {
        te=temp/PI;
        r=sqrt(te);
        temp=temp+100;
        n++;
    }
    return 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