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

为什么写成sum/12.0就错 写成sum/12就对了???也没有四舍五入。。???!!!

Posted by leslie_1 at 2010-07-12 17:42:04 on Problem 1004
#include<stdio.h>
int main()
{
	int i;
	double a,sum=0.0;
	for(i=0;i<12;i++)
	{
		scanf("%lf",&a);
		sum+=a;
	}
	printf("$%.2f",sum/12);
	return 0;
}
我提交上面的就对了 
把倒数第二行最后写成sum/12.0就wa   why???

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