| ||||||||||
| 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:用G++报WA,后将double换成 long double仍WA,无奈,试了一下C++,竟AC了,无语。。。In Reply To:用G++报WA,后将double换成 long double仍WA,无奈,试了一下C++,竟AC了,无语。。。 Posted by:jiyanmoyu at 2009-08-12 20:08:44 代码
#include<stdio.h>
#include<math.h>
const long double PI=acos(-1.0);
int main()
{
int t,i,n;
long double R,m;
scanf("%d",&t);
for(i=1;i<=t;++i)
{
scanf("%Lf%d",&R,&n);
m=sin(PI/n);
printf("Scenario #%d:\n%.3Lf\n\n",i,m*R/(1.0+m));
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator