Go: package main

import (
    "fmt"
    "math"
)

func main() {
    var e int
    for {
        fmt.Scan(&e)
        if e == 0 { break }

        var ans float64 = float64(e)
        for z := 0; z <= 101; z++ {
            for y := 0; y <= 1001; y++ {
                x := e - y*y - z*z*z
                if (0 <= x && x <= 100000) {
                  ans = math.Min(ans, float64(x+y+z));
                }
            }
        }
        fmt.Println(ans)
    }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

void solve()
{
	int e;
	while(cin >> e, e)
	{
		unsigned long long int min_val = 999999999999999;
		for(int i = 0; i <= e; ++i)
		{
			for(int j = 0; j * j <= e; ++j)
			{
				for(int k = 0; k * k * k <= e; ++k)
				{
					unsigned long long int temp = i + j * j + k * k * k;
					int val = i + j + k;
					if(temp > e || val >= min_val)
					{
						break;
					}
					else if(temp == e)
					{
						min_val = val;
					}
				}
				if(min_val != 999999999999999)
				{
					goto END;
				}
			}
		}
END:
		cout << min_val << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int e;
  while(cin>>e,e){
    int ans = 1000000;
    for(int z=0;z*z*z<=e;++z){
      for(int y=0;y*y+z*z*z<=e;++y){
	int x = e-y*y-z*z*z;
	ans = min(ans,x+y+z);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;

int main() {
	int e;
	while(cin >> e && e > 0) {
		int x, y, z;
		int maxz, maxy;
		int min = 1000000;
		//maxz = int(pow(e, 1.0/3.0));
		//maxy = int(pow(e, 1.0/2.0));
		//cout << "maxz:" << maxz << endl;
		//cout << "maxy:" << maxy << endl;
		for(int z = 0; z*z*z <= e; z++) {
			for(int y = 0; y*y <= e; y++) {
				x = e - y*y - z*z*z;
				if(x >= 0 && x+y+z < min) min = x+y+z;
			}
		}
		cout << min << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
    int e;
    cin >>e;

    while(e)
    {
        int x=0;
        int y=0;
        int z=0;
        int m=0;
     for(z=0;z*z*z<=e;z++)
        for(y=0;z*z*z+y*y<=e;y++)
        {
            x = e-z*z*z-y*y;
            if(x<0)
                continue;

                int t = x+y+z;
                if(m ==0||m>t)
                    m=t;
            }

        cout <<m<<endl;




        cin >>e;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(x) for(auto it=(x).begin();it!=(x).end();it++) 
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

int main(){
    while(1){
        int e;
        int ans=1e9+7;
        cin>>e;
        if(e==0)break;
        
        for(int i=0;i<=e;i++){
            for(int j=0;i+j*j<=e;j++){
                for(int k=0;i+j*j+k*k*k<=e;k++){
                    if(i+j*j+k*k*k==e)ans=min(ans,i+j+k);
                }
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;

int main(int argc, char *argv[])
{
    int x, y, z, e, m;
    while (cin >> e, e) {
        m = 1000000;
        for (z = 0; z * z * z <= e; ++z) {
            y = sqrt(e - z * z * z);
            x = e - z * z * z - y * y;
            m = min(m, x + y + z);
        }
        cout << m << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>

using namespace std;

int INF = 10000000000000;

int cast(int e)
{
	
	

	 int Min = INF;

	 for(int i = 0;i <= 100;i++)
	 {
		 for(int j = 0;j <= 1000;j++)
		 {
			 int k = e - pow(i,3) - pow(j,2);
			 if(k >= 0)
			 Min = min(i+j+k,Min);
		 }
	 }


	return Min;
}


int main()
{

  while(1)
  {
	 int e;

	 cin >> e;
 
	 if(!e)break;
	
	 cout << cast(e) << endl;

  }

  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>

using namespace std;

#define INF 1010001000
#define EPS 1e-10
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back

typedef pair<int, int> i_i;
typedef long long int llong;
typedef pair<llong, llong> ll_ll;
typedef struct edge {int f, t;}Edge;


int main()
{
    int n;
    while (cin >> n, n) {
        int ans = INF;
        for (int i = 0; i*i*i <= n; i++) {
            for (int j = 0; i*i*i + j*j <= n; j++) {
                int k = n - (i*i*i + j*j);
                ans = min(ans, i+j+k);
            }
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
	const int intmax  = 1000001;
	ll int e;
	while(cin >> e,e){
		ll int ans = 9999999;
		FOR(y,0,sqrt(e)+1){
			FOR(z,0,cbrt(e)+1){
				if(e-y*y-z*z*z>=0) ans = min(ans,y+z+(e-y*y-z*z*z));
			}
		}
		cout << ans << endl;
	}
	
}

C++: /*
 * 宇宙ヤシガニ（枝狩り問題）
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2012
 */
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#include<sstream>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define ALL(c) (c).begin(), (c).end()
#define dump(a) cerr << #a << "=" << (a) << endl
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> void chmin(T &t, T f) { if (t > f) t = f; } //t=min
template<class T> void chmax(T &t, T f) { if (t < f) t = f; } //t=max
using namespace std;

int main() {
	// x=1,000,000
	// y=1,000
	// z=100

	int min_m=INT_MAX,m=0;
	int E;
	int x,zz;
	while(cin >> E && E) {
		min_m=E,m=E;
		rep(z,100) {
			zz = E - z*z*z;
			if (zz >= 0) {
				rep(y,1000) {
					x = zz - y*y;
					if (x >= 0) {
						m = x + y + z;
						//dump(E);
						//cout<<"m="<<m<<" x="<<x<<" y="<<y<<" z="<<z<<endl;
						chmin(min_m,m);
					}
					else { break; }
				}
			}
			else { break; }
		}
		cout << min_m << endl;
		
	}

	return 0;
}