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;

int y, z , e;

int main()
{
	cin >> e;
	while (e != 0) {
		y = z = 0;
		int mi = 100000000;
		
		for (; z * z * z <= e; z++) {
			for (y = 0; z * z * z + y * y <= e; y++) {
				mi = min(mi, z + y + (e - z * z * z - y * y));
			}
		}
		cout << mi << endl;
		cin >> e;
	}
	return 0;
}

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

int main ()
{
    int e;
    int dp[1000001];
    for (int i = 0; i <= 1000000; i++) dp[i] = 101;

    for (int i = 0; i <= 100 && i < 101; i++) {
        for (int j = 0; i + j * j <= 10000 && i + j < 101; j++) {
            for (int k = 0; i + j * j + k * k * k <= 1000000 && i + j + k < 101; k++) {
                int E = i + j * j + k * k * k;
                dp[E] = min(dp[E], i + j + k);
            }
        }
    }

    while (cin >> e, e) {
        cout << dp[e] << endl;
    }

    return 0;
}

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

int main(void){
	int e;
	while(cin >> e,e){
		int cmin=e;
		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;
				int m=x+y+z;
				cmin=min(cmin,m);
			}
		}
		cout << cmin << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <stack>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <functional>
#include <string>
#include <cstdlib>
#include <numeric>
#include <cstdbool>
#include <map> 
#include<set>
#include<queue>

typedef long long ll;


#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1000000000000000;
const ll inf = -1e18;
typedef pair<int, int> P;
ll ma = 1000000000 + 7;
ll mx = 1000003;
ll h, w, n,m; string s,t;
char maze[60][60];
int dis[101][101]; int graph[52][52]; bool vis[52];
int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, 1, 0, -1 };
ll gcd(ll x, ll y) {
	if (x % y == 0) return y;
	return gcd(y, x % y);

}
ll lcm(ll a,ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
void comb(vector<vector <ll> >& v) {
	for (ll i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (ll k = 1; k < v.size(); k++) {
		for (int j = 1; j < k; j++) {
			v[k][j] = (v[k - 1][j - 1] + v[k - 1][j]);
		}
	}
}
vector<ll> ee(1000010);
int main() {
	ll a=1;
	for (ll i = 0; a != 0; i++) {
		cin >> a;
		if (a == 0) {
			n = i;
			break;
		}
		ee[i] = a;
	}
	rep(i, n) {
		ll m = INF;
		ll zz = 0;
		ll yy = 0;
		ll y, z;
		for (z = 0; zz <= ee[i]; z++) {
			zz = z * z * z;
			for (y = 0; yy <= ee[i]; y++) {
				yy = y * y;
				if (yy > ee[i] - zz) {
					y--;
					yy = y * y;
					ll x = ee[i] - zz - yy;
					if (x >= 0) chmin(m, x + y + z);
					break;
				}
			}
		}
		cout << m << endl;
	}

}

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

#define CH(N,A,B) (A<=N&&N<B)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=(b-1);a<=i;i--)

using namespace std;

const int INF = 1e9;
int e;

int main() {

  while(1){
    cin>>e;
    if(e==0) break;
    int m = INF;
    for(int z = 0; z <= 100; z++){
      for(int y = 0; y <= 1000; y++){
        int x = e - y*y - z*z*z;
        if(x < 0) continue;
        m = min(m,x+y+z);
      }
    }
    cout<<m<<endl;
  }

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (ll)(1E9+7)
#define PI 3.1415926535897932384

template <class T>ostream &operator<<(std::ostream &o, const vector<T> &v)
{
	rep(i, v.size()) {
		o << (i > 0 ? " " : "") << v[i];
	}
	return o;
}



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

C++: #include <iostream>


using namespace std;

int solve(int n){
  int e = 1e6;
  for (int i = 0; i*i*i <= n ; ++i)
  {
    for (int k = 0; k*k <= n - i*i*i; ++k)
    {
      e = min(e, n-i*i*i-k*k+i+k);
    }
  }
  return e;
}


int main(){
  int n;
  while(true){
    cin >> n;
    if (n == 0)
    {
      break;
    }
    cout << solve(n) << endl;
  }
}

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

using namespace std;

int e;

void solve() {
	int m = e;
	
	for (int y = 0; y * y <= e; y++) {
		for (int z = 0; z * z * z <= e; z++) {
			int x = e - (y * y) - (z * z * z);
			if (0 <= x) {
				m = min(m, x + y + z);
			}
		}
	}
	
	cout << m << endl;
}

int main() {
	while (1) {
		cin >> e; if (e == 0) break;
		solve();
	}
	
	return 0;
}

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

int e;

int main() {
  while (1) {
    scanf("%d", &e);
    if (e == 0) return 0;

    int ans = e;
    for (int z=zmax; z*z*z<=e; z++) {
      int z3 = z*z*z;
      for (int y=0; y*y+z3<=e; y++) {
        int y2 = y*y;
        ans = min(ans, y+z+e-y2-z3);
      }
    }

    printf("%d\n", ans);
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int e,minx,x,y,z;
  while(cin >> e && e){
    if(e == 1)cout << 1 << endl;
    else{
      minx = 1000001;
      for(z=0;z*z*z<=e;z++){
	y = (int)sqrt(e-z*z*z);
	x = e-z*z*z-y*y;
	minx = min(minx,x+y+z);
      }
      cout << minx << endl;
    }
  }
}

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

int e;
int main() {
    while (cin >> e, e != 0) {
        int m = 1<<28;
        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;
                m = min(m, x+y+z);
            }
        }
        cout << m << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int e;
	while (cin >> e) {
		if (e == 0) {
			break;
		}
		int i, j, k;
		for (i = 0; ; i++) {
			for (j = 0; ;j++) {
				for (k = 0; ;k++) {
					if (i + j*j + k*k*k == e) {
						break;
					} else if (i + j*j + k*k*k > e) {
						k--;
						break;
					}
				}
				if (i + j*j + k*k*k == e) {
					break;
				} else if (i + j*j + k*k*k > e) {
					j--;
					break;
				}
			}
			if (i + j*j + k*k*k == e) {
				cout << i+j+k << endl;
				break;
			}
		}
	}
	return 0;
}