Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <fstream>
- using namespace std;
- ifstream fin("tablita.in");
- ofstream fout("tablita.out");
- int main()
- {
- int n, delta, g;
- double x;
- fin>>n;
- delta=1+8*n;
- x=(-1+sqrt(delta))/2.0;
- if (x==int(x)) g=x;
- else g=x+1;
- fout<<g;
- fin.close();
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement