Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
少年敢再求个距离吗?
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 11, Accepted users: 11
Problem 11616 : No special judgement
Problem description
  给定一个二维坐标点,求该点到原点的二维距离和直角距离。
tip:点A(x1,y1),B(x2,y2)之间直角距离d=|x1-x2|+|y1-y2| 。
程序中必须包括下面的内容:
class point
{
protected:
int x,y;
public:
void set_point(int a,int b) { x = a,y = b; }
virtual void dis() {cout << "Undefinition." << endl; }
};

Input
  第一行输入一个整数t(1<=t<=100),代表测试数据组数 。每组数据一行,该行包括两个整数a,b表示一个直角坐标系下的坐标 (-100<=a,b<=100),中间用空格隔开。

Output
  对于每组测试数据,输出该点到原点的二维距离和直角距离,每个一行。 二维距离保留两位小数。

Sample Input
2
1 1
3 4
Sample Output
1.41
2
5.00
7
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:2051 today,16258778 total, since 2010-05-07