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 20124233 at 2014-05-12 14:11:42 on Problem 2101
#include <iostream>
#include <stdio.h>
#include<math.h>
int main()
{
	int n, e;
	double l1,l2,a;
    std::cin>>n>>e; 
	l1 = l2 = 0;
	n--, e--;
	while(n--)std::cin>>a, l1 += a;
	while(e--)std::cin>>a, l2 += a;
	a= sqrt(l1*l1+l2*l2);
	a=a-(int)a==0?a:int(a+1);
	std::cout<<a<<std::endl;
}

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