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

蒟蒻的AC纪念

Posted by CrystalBall at 2016-10-05 00:23:55 on Problem 1004
#include <stdio.h>
#include <ctype.h>

const int nmon = 12;

double Myscan()
{
	int t;
	int power = 1;
	double *n = 0.0;
	
	while ((t=getchar()) != EOF && isdigit(t))
		*n = *n * 10 + t - '0';
	if (t=='.')
	{
		while ((t=getchar()) != EOF && isdigit(t))
		{
			*n = *n * 10 + t- '0';
			power *= 10;
		}
	}
	return *n / power;
}

int main()
{
	int i;
	double sum = 0;
	
	for (i=1; i<=nmon; i++)
		sum += Myscan();
	printf("$%.2lf\n", sum/12);
	return 0;
}

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