#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define pf printf
#define sf scanf
int main()
{
int n, sum , temp, count, i;
sf("%d", &n);
count = 0;
sum = 0;
temp = 0;
for(i=1;;i++)
{
sum = sum + i;
temp = sum + temp;
if(temp>n)
{
break;
}
count++;
}
pf("%d\n", count);
}
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define pf printf
#define sf scanf
int main()
{
int n, sum , temp, count, i;
sf("%d", &n);
count = 0;
sum = 0;
temp = 0;
for(i=1;;i++)
{
sum = sum + i;
temp = sum + temp;
if(temp>n)
{
break;
}
count++;
}
pf("%d\n", count);
}
No comments:
Post a Comment