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

水题~(第一次贴代码)

Posted by dizem at 2009-07-31 00:42:04 on Problem 2101
#include "stdio.h"
#include "math.h"
int main()
{
	int n, e;
	double l1,l2,a;
	scanf("%d%d",&n, &e);
	l1 = l2 = 0;
	n--, e--;
	while(n--) scanf("%lf",&a), l1 += a;
	while(e--) scanf("%lf",&a), l2 += a;
	l1 = sqrt(l1*l1+l2*l2);
	printf("%.0lf\n", ceil(l1));
}

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