#include <iostream> using namespace std; int main() { int s; int n = 1; cin >> s; while(s > 0){ n++; s = s-n; } if (s < 0) { n--; } cout << n; return 0; }
To embed this project on your website, copy the following code and paste it into your website's HTML: