Guest User

Hello World.cpp

a guest
Apr 3rd, 2023
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #define int int64_t                            
  4. using std::pow, std::llround;
  5.  
  6. int func(int n)
  7. {
  8.     long double result =
  9.     (-10303.0 / 9979200.0L)    * pow(n, 11) +
  10.     (4073.0  / 64800.0L)       * pow(n, 10) -
  11.     (67169.0 / 40320.0L)       * pow(n, 9)  +
  12.     (108929.0 / 4320.0L)       * pow(n, 8)  -
  13.     (36326569.0 / 151200.0L)   * pow(n, 7)  +
  14.     (32342993.0 / 21600.0L)    * pow(n, 6)  -
  15.     (445599449.0 / 72576.0L)   * pow(n, 5)  +
  16.     (210189113.0 / 12960.0L)   * pow(n, 4)  -
  17.     (3951504773.0 / 151200.0L) * pow(n, 3)  +
  18.     (20582609.0 / 900.0L)      * pow(n, 2)  -
  19.     (12420907.0 / 1540.0L)     * n + 72;
  20.    
  21.     return llround(result);
  22. }
  23.  
  24. int32_t main()
  25. {
  26.     for(int i = 0; i < 12; ++i)
  27.         std::cout << static_cast<char>(func(i));
  28.    
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment