PROGRAMMING:The problem of data spacing
The complex class has two data members: A and B, which represent the real part and imaginary part of the complex respectively, and has several constructors and an overloaded member function (minus sign, calculating the distance between two complex numbers).
Require the design of a function template
template < class T >
double dist(T a, T b)
For int, float, complex or other types of data, return the distance between two data.
###Input format:
Each line has an operation. The first number of each line is the element type. 1 is an integer element, 2 is a floating-point element, and 3 is a complex element. If it is an integer element, then enter two integer data. If it is a floating-point element, then enter two floating-point data. If it is a complex element, enter two complex data (A1, B1, A2, B2). When you enter 0, it marks the end of the input.
###Output format:
For each input, output a spacing value per line.
###Input example:
```in
1 2 5
3 2 4 5 9
2 2.2 9.9
0
```
###Output example:
```out
three
five point eight three zero nine five
seven point seven
```
answer:If there is no answer, please comment
Require the design of a function template
template < class T >
double dist(T a, T b)
For int, float, complex or other types of data, return the distance between two data.
###Input format:
Each line has an operation. The first number of each line is the element type. 1 is an integer element, 2 is a floating-point element, and 3 is a complex element. If it is an integer element, then enter two integer data. If it is a floating-point element, then enter two floating-point data. If it is a complex element, enter two complex data (A1, B1, A2, B2). When you enter 0, it marks the end of the input.
###Output format:
For each input, output a spacing value per line.
###Input example:
```in
1 2 5
3 2 4 5 9
2 2.2 9.9
0
```
###Output example:
```out
three
five point eight three zero nine five
seven point seven
```
answer:If there is no answer, please comment