| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with C++ -- max. value
hello everyone...
i am beginner in C++ and i need your help to determine the maximum value of results((how can i determine the maximum value of Y and print it with its corresponding values?)) ......here is the program (sample run) ********************************************** Welcome Calculating a Trajectory Followed by a Projectile Enter initial velocity [m/s]: 100 Enter initial angle [degree]: 60 Position and velocity t x y vx vy 0.00 0.00 0.00 50.00 86.60 1.00 50.00 81.70 50.00 76.79 2.00 100.00 153.59 50.00 66.98 3.00 150.00 215.66 50.00 57.17 4.00 200.00 267.93 50.00 47.36 5.00 250.00 310.39 50.00 37.55 6.00 300.00 343.04 50.00 27.74 7.00 350.00 365.87 50.00 17.93 8.00 400.00 378.90 50.00 8.12 9.00 450.00 382.12 50.00 -1.69 10.00 500.00 375.53 50.00 -11.50 APEX: t_max x_max y_max vx_max vy_max 9.00 450.00 382.12 50.00 -1.69 ********************************************** |
|
#2
|
|||
|
|||
|
Quote:
You can enlist the values of Y and sort them.There are several sorting algorithms available. Keep track of position of max element in the original list and obtain values corresponding to that index numbers for other fields. |
|
#3
|
|||
|
|||
|
Quote:
Thankx |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Help with C++ -- max. value |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|