Advertisement
STANAANDREY

1223334444

Sep 17th, 2019
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. #include "bits/stdc++.h"
  2. using namespace std;
  3.  
  4. unsigned getterm(unsigned n)
  5. {
  6.     return (((1) + (double) sqrt(1 + 8 * n)) / 2);
  7. }
  8.  
  9. int main()
  10. {
  11.     cout << getterm(7);//4
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement