Advertisement
punidota

Untitled

Sep 7th, 2015
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <math.h>
  4.  
  5. using namespace std;
  6. #define p 9.8
  7. #define g 3.14159265
  8.  
  9. int main(int argc, _TCHAR* argv[])
  10. {
  11.  
  12.     double L;
  13.     char v[255];
  14.     char a[255];
  15.  
  16.     printf("Vvedit' znachen'a nyl'ovoy shvudkosty (v metrah na sekundu) ta kut (v graducah):\n ");
  17.     cout << "v = ";
  18.     cin >> v;
  19.     if (v < 0)
  20.         printf("Shvudkist' menshe nyla");
  21.     else
  22.  
  23.     {
  24.         cout << "a = ";
  25.         cin>>a;
  26.  
  27.     }
  28.    
  29.     L = (atof(v)*atof(v)*sin(atof(a) * p / 180)) / g;
  30.     printf("Dovguna poloty:%f \n", L);
  31.  
  32.     system("pause");
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement