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 <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef complex<double> P;
static const double EPS = 1e-8;
static const int INF = (int)1e8;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) for (int i=0; i<(int)(n); ++i)
#define FOREQ(i,k,n) for (int i=(k); i<=(int)(n); ++i)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define FIND(m,w) ((m).find(w)!=(m).end())

int main(void){
  int e;
  while(cin>>e,e){
    int ans = e;
    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<math.h>

using namespace std;

int main() {
  int e, x, y, z, y_max, z_max, ans;
  while(true) {
    cin >> e;
    if(e == 0) break;
    ans = e;
    z_max = (int) pow(e, 1.0/3.0);
    for(z = 0; z <= z_max; z++) {
      y_max = (int) sqrt(e-z*z*z);
      for(y = 0; y <= y_max; y++) {
	x = e - y*y - z*z*z;
	if(ans > x+y+z) ans = x+y+z;
      }
      if(z == z_max) cout << ans << endl;
    }
  }

  return 0;
}

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

int main()
{
    int x, e;
    int sum_min;

    while (std::cin >> e && e > 0) {
        sum_min = 100000000;
        for (int i = 0; i * i <= e; i++) {
            for (int j = 0; j * j * j <= e - i * i; j++) {
                x = e - i * i - j * j * j;
                if (x >= 0 && x + i + j < sum_min) {
                    sum_min = x + i + j;
                }
            }
        }
        std::cout << sum_min << '\n';
    }
    return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int solve(int E)
{
    int ans=3000000;
    int x;
    for(int y=0;y<=1000;++y)
        for(int z=0;z<=100;++z)
        {
            x=E-y*y-z*z*z;
            if((x+y+z<ans)&&(x>=0))
                ans=x+y+z;
        }
    return ans;
}
int main()
{
    int E;
    while(cin>>E&&E>0)
        cout<<solve(E)<<endl;
    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int e;
	while (cin >> e) {
		if (e == 0) {
			break;
		}
		int i, j, k, m;
		bool hantei = false;
		for (m = 1; ; m++) {
			if (m*m*m < e) {
				continue;
			}
			for (k = m; k >= 0; k--) {
				for (j = m-k; j >= 0; j--) {
					for (i = m-k-j; i >= 0; i--) {
						if (i+j*j+k*k*k > e) {
							break;
						}
						if (i+j*j+k*k*k == e) {
							hantei = true;
							break;
						}
					}
					if (hantei) {
						break;
					}
				}
				if (hantei) {
					break;
				}
			}
			if (hantei) {
				break;
			}
		}
		cout << m << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int E;

int main(){
  while( cin >> E && E ){
    int res = E;
    for(int z=0;z*z*z<=E;z++){
      for(int y=0;y*y<=E-z*z*z;y++){
        int x = E - z*z*z - y*y;
        if( x < 0 ) break;
        res = min( res, x + y + z );
      }
    }
    cout << res << endl;
  }
}

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

#define MAX 1000000
int min(int a, int b);

int min(int a, int b) {
    if (a > b)
        return b;
    else
        return a;
}
int main()
{
    while (1)
    {
        int y, z, e, ans = MAX;
        cin >> e;
        if (!e)
            break;
        for (z=0; z*z*z <= e; z++) {
            y = (int)sqrt((double)e - z*z*z);
            ans = min(ans, e - y*y - z*z*z + y + z);
        }
        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 dou(int a){
  return a*a;
}

int tri(int a){
  return a*a*a;
}
 
int main(){

  while(1){
	double e;
	cin >> e;
	if(e==0) break;

	int x,y,z;

	int cb = cbrt(e);
	
	int m = 1000000;

	REP(i,cb){
	  z = cb - i;
	  int huga = sqrt(e - tri(z));
	  REP(j,huga){
		y = huga - j;
		x = e - tri(z) - dou(y);
		if(m>(x+y+z)) m = x+y+z;
	  }
	}

	cout << m << endl;

	//	cout << z << endl;


  }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int x,y,z;
int e;
int solve(){
	int minnum=0;
	if(sqrt(e) == int(sqrt(e)))
	{
		minnum = sqrt(e);
	}
	else
	{
		z = (int)pow(e,1.0/3);
		y = (int)sqrt(e - z*z*z);
		x = (int)(e - z*z*z - y*y); 
		minnum = x+y+z;
	}

    return minnum;
};
int main(){
    int A[100000];
    int k = 0;
    while( cin>>e && e>0 )
    {
        A[k]=solve();
        k++;
    }
    for(int l = 0;l < k; l++)
    {
        cout<<A[l]<<endl;
    }
    return 0;
}

C++: // Space Coconut Crab
#include <iostream>
using namespace std;
int count = 0; // ?¨???¬??¨ global ?????°
int solve(int E) {
  // ?????´????±???????
  // x+y*y+z*z*z=E
  int ans = E; // ?????§??? 
  for (int z=0; z*z*z<=E; ++z)
    for (int x=0; x<=E-z*z*z; ++x)
      for (int y=0; y*y<=E-x-z*z*z; ++y) {
        ++count;
        if (x+y*y+z*z*z == E)
          if (x+y+z < ans) // x+y+z??????????°??????????ans?????´??°
            ans = x+y+z;
      }
  return ans;
}
int main() {
  int E;
  while (cin >> E && E>0) {
    cout << solve(E) << endl; 
  }
}
// ?????´?????????????????¨?????????????????????????????? 10^11???...8?§???\?????????
// xy????±??????????z????±??????????????????????????????????
// zy
// xz

C++: #include <iostream>
#include <cmath>
using namespace std;
using ll = long long;
int main(void){
	while(1){
		ll num,ans=1000000;
		cin >> num;
		if(!num)	break;
		for(ll x=0;x<=num;x++){
			for(ll y=0;y<=sqrt(num-x);y++){
				for(ll z=0;pow(z,3)<=num-x-pow(y,2);z++){
					ll kazu=x+pow(y,2)+pow(z,3);
					if(kazu>num)	break;
					if(kazu==num){
						//cout << x << ' ' << y << ' ' << z << endl;
						ans = min(ans,(x+y+z));
						
					}
				}
			}
		}
		cout << ans << endl;
}
	return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
  int e = 1;
  while(1){
    int z = 0, y = 0, x = 0;
    int min_m = 1000000000;
    cin >> e;
    if(e == 0) break;
    // cout << "e: " << e << endl;
    while( e - pow(y,2) >= 0){
      z = 0;
      while(e - pow(y, 2) - pow(z,3) >= 0){
	x = e - pow(y,2) - pow(z,3);
	int m = x + y + z;
	// cout << "x" << x << "y" << y << "z" << z << endl;
	if (m < min_m){
	  min_m = m;
	}
	z++;
      }
      y++;
    }
    cout << min_m << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(void){
	int e;
	while(1){
		cin >> e;
		if(!e) break;
		int ans = 1000001;
		for(int z = 0; z*z*z <= e; ++z){
			for(int y = 0; z*z*z+y*y <= e; ++y){
				ans = min(ans,e-(z*z*z+y*y)+y+z);
			}
		}
		cout << ans << endl;
	}
	return 0;
}