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 |
菜鸟请教哪里错了?调试都对啊#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator