#include<stdio.h> #include<math.h> int main() { int r; while(scanf("%d",&r)!=EOF&&r!=0) { double s=(double)r*r; //double s=r*r;//会wrong double r1=sqrt(s/3); double r2=sqrt(s*2/3); printf("%.3lf %.3lf ",r1,r2); } return 0; }
#include<stdio.h> #include<math.h> int main() { int r; while(scanf("%d",&r)!=EOF&&r!=0) { double s=(double)r*r; //double s=r*r;//会wrong double r1=sqrt(s/3); double r2=sqrt(s*2/3); printf("%.3lf %.3lf ",r1,r2); } return 0; }