# include # include # include using namespace std; int main ( ) { float t, vx, vy, x, y; vx = 100; vy = 200; for ( t = 0; t <= 20; t++ ) { x = vx * t; y = vy * t - 16.0 * t * t; cout << t << " " << x << " " << y << "\n"; // // Stop if the arrow has returned to the ground. // if ( y <= 0.0 && 0.0 < t ) { cout << "The arrow landed by " << t << " seconds.\n"; break; } } return 0; }