Question: use c programing please (cout and cin) not printf Challenge task Three runners are running towards the end point. you are given the location of
use c programing please (cout and cin) not printf
Challenge task
Three runners are running towards the end point. you are given the location of the end point at (e0,v0,t0). You are asked to write a program to find the nearest runner to the end point if you are given the locations (e1,v1,t1) for the first runner and (e2,v2,t2) for the second runner.
Note 1: you have to use the predefined pow function
Note2: you have to use predefined min and sqrt functions
Note3: the distance between two points (a, b,c) and (d,e,f) is calculated using the equation: sqrt ((ad)2+(be)2+(cf)2)
Constraints
0 <= e0, e1, e2 <= 50
0 <= v0, v1, v2 <= 50
0 <= t0, t1, t2 <= 50
Input Format
The first line, Three integer numbers separated by spaces representing the location of the end point
e0,v0,t0
The second line, six integer numbers separated by spaces represent the location coordinates (e, v, t) of the other two points e1, e2, v1, v2, t1, t2
Output Format
The nearest runner to the end point.
(use float or double data type for the result without approximation)
Sample #1
Input
1 4 6 5 8 9 6 3 2
Output
8.30662
Sample #2
Input
5 8 9 10 5 7 15 32 25
Output
23.5584
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
