Here is the translation of the programming task text from Russian to English: Structure Point and calculating distance from the origin
Go
Easy
structs
Task «Here is the translation of the programming task text from Russian to English: Structure Point and calculating distance from the origin»
Create a structure Point with fields X and Y (type float64). Write a function DistanceFromOrigin that takes a Point and returns the distance from the point to the origin (0,0). Two numbers are entered — the coordinates of the point. Output the distance with an accuracy of two decimal places.
Input Format
Two real numbers X and Y, separated by a space.
Output Format
One real number — the distance from the point to the origin, rounded to two decimal places.
Examples
Example 1
INPUT
0.0 0.0
OUTPUT
0.00
Example 2
INPUT
5
1 1 1 1 1
OUTPUT
1.41
main.go