标签:des style blog http color java os io
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1567 Accepted Submission(s): 570
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <math.h> 5 #include <algorithm> 6 #define eps 0.0005 7 #define pi 3.14159265 8 int main() 9 { 10 int n,m,i,j; 11 scanf("%d",&n); 12 while(n--) 13 { 14 double x1,y1,x2,y2,x3,y3; 15 double Q1=pi*2/3,Q2=pi*4/3; 16 scanf("%lf%lf",&x1,&y1); 17 x2=x1*cos(Q1)-y1*sin(Q1); 18 y2=y1*cos(Q1)+x1*sin(Q1); 19 x3=x1*cos(Q2)-y1*sin(Q2); 20 y3=y1*cos(Q2)+x1*sin(Q2);//printf("%.3lf %.3lf %.3lf %.3lf\n",x2,y2,x3,y3); 21 if(fabs(y2-y3)<eps) 22 { 23 if((x2-x3)>eps) 24 printf("%.3lf %.3lf %.3lf %.3lf\n",x3,y3,x2,y2); 25 else 26 { 27 printf("%.3lf %.3lf %.3lf %.3lf\n",x2,y2,x3,y3); 28 } 29 } 30 else if((y2-y3)>eps) 31 printf("%.3lf %.3lf %.3lf %.3lf\n",x3,y3,x2,y2); 32 else 33 printf("%.3lf %.3lf %.3lf %.3lf\n",x2,y2,x3,y3); 34 } 35 return 0; 36 }
hdu 1700 Points on Cycle(坐标旋转),布布扣,bubuko.com
hdu 1700 Points on Cycle(坐标旋转)
标签:des style blog http color java os io
原文地址:http://www.cnblogs.com/ccccnzb/p/3904864.html