Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
水啊!贴一下代码!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator