Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:为什么用double不行改成float就行啦呢!

Posted by 8ab12097207 at 2009-07-13 16:22:09 on Problem 1799
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator