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:float精度不够

Posted by hejinlong55 at 2005-11-23 09:21:36 on Problem 1004
In Reply To:Re:float精度不够 Posted by:hejinlong55 at 2005-11-23 09:21:17
#include<stdio.h>
#include<math.h>
void main(){
	float a[12];
	float result=0;
	int i;
	for(i=0;i<11;i++){
		scanf("%f",&a[i]);
	}
	for(i=0;i<11;i++){
		result=result+a[i];
	}
	result=result/12;
	printf("$%.2f\n",result);
}

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