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> #include <math.h> #define PI 3.1415 float R(float x,float y)//圆半径 { float sumx,sumy,sum; sumx=x*x; sumy=y*y; sum=sumx+sumy; return (sqrt(sum)); } float S(float c)//半圆面积 { float sum,sumx; sumx=c*c; sum=(PI*sumx)/2.0; return sum; } int main() { float N,sum,c,r,s; float X[100],Y[100],A[100]; int i; printf("输入N:"); scanf("%f",&N); for(i=0;i<N;i++) { scanf("%f%f",&X[i],&Y[i]); } for(i=0;i<N;i++) { sum=0; r=R(X[i],Y[i]); s=S(r); sum=s/50; A[i]=(sum-0.5)+1; } for(i=0;i<N;i++) { printf("属性%d: 该属性将在第%0.f年开始侵蚀 \n",i+1,A[i]); if(i==N-1) printf("输出结束"); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator