Next time post in the existing thread.
Try using double instead of float.
12578 - 10:6:2
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 12578 - 10:6:2
Check input and AC output for thousands of problems on uDebug!
Re: 12578 - 10:6:2
Hi
Why i get WA?
Why i get WA?
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;
}