Advertisement
noshin98

uva 12704

Jul 5th, 2016
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5.     int t,i;
  6.     double x,y,r,ans,s1,s2;
  7.     while(scanf("%d",&t)==1)
  8.     {
  9.         x=0,y=0,r=0;
  10.         for(i=1;i<=t;i++)
  11.         {
  12.             scanf("%lf%lf%lf",&x,&y,&r);
  13.             ans=sqrt(x*x+y*y);
  14.             s1=r-ans;
  15.             s2=r+ans;
  16.             printf("%.2lf %.2lf\n",s1,s2);
  17.  
  18.         }
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement