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 <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double e;
  while(cin >> e && e){
    double m = inf;
    for(int i = 0; i * i * i <= e && i <= 100; ++ i){
      for(int j = 0; j * j <= e - pow(i,3); ++ j){
        if(e - pow(i,3) - pow(j,2) >= 0 && e - pow(i,3) - pow(j,2) <= 1000000){
          m = min(m,i+j+e-pow(i,3)-pow(j,2));
        }
      }
    }
    cout << m << endl;
  }
  return 0;
}

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

const int INF = 1e+8;
const int E_MAX = 1000000;

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

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

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

C++: #include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define Repr(i, n, a) for (int i = (n); i >= (a); i--)
#define rep(i, n) Rep(i, 0, n)
#define repr(i, n) Repr(i, n, 0)
#define all(a) a.begin(), a.end()
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int e;
    while (1)
    {
        cin >> e;
        if (e == 0)
            break;
        int ans = INF;
        for (int i = 0; i * i * i <= e; i++)
        {
            for (int j = 0; i * i * i + j * j <= e; j++)
            {
                int num = e - i * i * i - j * j;
                if (num >= 0)
                    ans = min(ans, i + j + num);
            }
        }
        cout << ans << endl;
    }
}

C++: #include<cstdio>
#include <string>
main(){int e;while(scanf("%d",&e)&&e){int m=1<<30;for(int z=0,c=0;c<=e;c=++z*z*z)for(int y=0,b=0;c+b<=e;b=++y*y)m=std::min(m,e-c-b+y+z);printf("%d\n",m);}}

C++: #include <bits/stdc++.h>

#define FOR(i, a, b) for(long long int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;



int main(void) {
	
	while (1) {
		int e;
		bool flag = true;
		int mini = INF;

		cin >> e;
		if (e == 0) {
			break;
		}
		RFOR(z, cbrt(e)+1, 0) {
			if (pow(z, 3) > e) {
				continue;
			}
			RFOR(y, sqrt(e-pow(z,3))+1, 0) {
				if (pow(y, 2) > e - pow(z, 3)) {
					continue;
				}
				if (pow(y, 2) == e - pow(z, 3)) {
					mini = z + y;
					flag = false;
					break;
				}
				else {
					if (mini > z + y + e - pow(z, 3) - pow(y, 2)) {
						mini = z + y + e - pow(z, 3) - pow(y, 2);
					}
				}
			}
			if (flag == false) {
				break;
			}
		}
		cout << mini << endl;
	}

}

C++: #include <iostream>

using namespace std;

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

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

int main() {
    while (true) {
        int e;
        cin >> e;
        if (e == 0) {
            break;
        }
        int minM = 1000000;
        for (int x = 0; x <= e; x++) {
            for (int y = 0; x + pow(y, 2) <= e; y++) {
                for (int z = 0; x + pow(y, 2) + pow(z, 3) <= e; z++) {
                    if (x + pow(y, 2) + pow(z, 3) == e && minM > x + y + z) {
                        minM = x + y + z;
                    }
                }
            }
        }
        cout << minM << endl;
    }
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL

#define MAX 1000000

int main() {

	for (int e; cin >> e&&e;) {
		int m = INF;
		int max_z = pow(e, 1. / 3);
		for (int z = max_z; z >= 0; z--) {
			int tmp = e;
			tmp -= z*z*z;
			int y = pow(tmp, 1. / 2);
			tmp -= y*y;
			int x = tmp;
			m = min(m, x + y + z);
		}
		cout << m << endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define INF 1000000
int main() {
    int e;
    vector<int> y, z;
    for (int i=0;;i++) {
        if (i*i>INF) break;
        y.push_back(i*i);
    }
    for (int i=0;;i++) {
        if (i*i*i>INF) break;
        z.push_back(i*i*i);
    }
    while (scanf("%d",&e)) {
        if (e==0) break;
        int m=INF+1;
        for (int i=0; i<y.size(); i++) {
            if (y[i]>e) break;
            for (int j=0; j<z.size(); j++) {
                if (z[j]>e) break;
                if (y[i]+z[j]>e) break;
                m = min(m, e-y[i]-z[j]+i+j);
            }
        }
        printf("%d\n",m);
    }
}

C++: #include<stdio.h>
#include<string.h>
#include<math.h>


int main(){
	int x,y,z,e,m;
	
	while(~scanf("%d",&e)){
		if(e==0)break;
		m=e;
		for(z=0;z*z*z<=e;z++){
			for(y=0;z*z*z+y*y<=e;y++){
				m=m>z+y+e-z*z*z-y*y?z+y+e-z*z*z-y*y:m;
			}
		}
		
		printf("%d\n",m);
	}
	return 0;
}