artemgf

Мячик во сне

May 7th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #define _USE_MATH_DEFINES
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <string>
  5. #include <set>
  6. #include <map>
  7. #include <algorithm>
  8. #include <string>
  9. #include <math.h>
  10. #include <vector>
  11. #include <cmath>
  12. #include <sstream>
  13.  
  14. using namespace std;
  15.  
  16. int main()
  17. {
  18.     double V, a, k, proms, S=0;
  19.  
  20.     cin >> V >> a >> k;
  21.  
  22.     proms = ((V*V)*sin(2 * ((a*3.1415926535) / 180))) / 10.0;
  23.     S = proms;
  24.  
  25.     cout.setf(ios::fixed);
  26.     cout.precision(2);
  27.  
  28.     while (proms > 0.0000000001)
  29.     {
  30.         proms /=k;
  31.         if (proms > 0.0000000001)
  32.         {
  33.             S += proms;
  34.         }
  35.     }
  36.    
  37.     cout << S;
  38.    
  39.  
  40.     _getch();
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment