| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:为什么用double不行改成float就行啦呢!In Reply To:Re:为什么用double不行改成float就行啦呢! Posted by:fairy_tales at 2009-05-11 13:21:29 > 用double可以的
下面是我的代码:
#include <stdio.h>
#include <math.h>
int main(int argc, char* argv[])
{
int t,n,i=1;
double R,r,k;
scanf("%d",&t);
while(t--)
{
scanf("%lf%d",&R,&n);
k=sin(3.141592629/n);
r=k*R/(1+k);//根据小圆与大圆的关系求出小圆半径.
printf("Scenario #%d:\n",i);
i++;
printf("%.3lf\n\n",r);
}
return 0;
}
AC了的
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator