Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bits/stdc++.h"
- using namespace std;
- unsigned getterm(unsigned n)
- {
- return (((1) + (double) sqrt(1 + 8 * n)) / 2);
- }
- int main()
- {
- cout << getterm(7);//4
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement