Advertisement
Guest User

Untitled

a guest
Jun 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main ()
  7. {
  8.  
  9.     double c = 12, g = 10, m = 0, h;
  10.     double v;
  11.     int j = 0;
  12.     double V[4] = {70, 0, 0, 0};
  13.    
  14.     cout << "Digite a sua massa: ";
  15.     cin >> m;
  16.  
  17.     v = g - ((c / m) * V[j]);
  18.     h = V[j+1] - V[j];
  19.  
  20.     for (j = 1; j < 4; j++)
  21.         V[j] = V[j-1] + h * v;
  22.    
  23.     for ( j = 0; j < 4; j++)
  24.         cout << "V[" << j << "]\t" << V[j] << "\n";
  25.  
  26.     system("pause");
  27.     return 0;
  28.    
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement