标签:code png print 半径 math eof main sharp info
完整代码:
#include<stdio.h> #include<math.h> int main() { float x1,y1,x2,y2,r; while(scanf("%f %f %f %f %f",&x1,&y1,&x2,&y2,&r)!=EOF) { float d; d=sqrt(pow((x2-x1),2)+pow((y2-y1),2)); if(d==0) { printf("重合\n"); } else if(d>2*r) { printf("相离\n"); }else if(d==2*r) { printf("相切\n"); }else{ double ang1=acos(d/(2*r)); printf("相交 %.2lf\n",2*ang1*r*r-d*r*sin(ang1)); } } }
标签:code png print 半径 math eof main sharp info
原文地址:https://www.cnblogs.com/Zhuohome/p/12853925.html