Re: 12578 - 10:6:2
Posted: Thu Oct 30, 2014 9:14 pm
Next time post in the existing thread.
Try using double instead of float.
Try using double instead of float.
The Online Judge board
https://uva.onlinejudge.org/board/
https://uva.onlinejudge.org/board/viewtopic.php?f=63&t=207063
Code: Select all
#include <stdio.h>
#include <math.h>
void zaokr2(double *liczba)
{
*liczba*=100;
*liczba=round(*liczba);
*liczba/=100.0;
}
int main(void)
{
int T,L;
scanf("%d",&T);
while(T--)
{
scanf("%d",&L);
double x=acos(-1)*L*L/25.0;
/*zaokr2(&x);*/
x*=100;
x=round(x);
x/=100.0;
printf("%.2lf %.2lf\n",x,L*L*0.6-x);
}
return 0;
}