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 <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main(void){
    // Your code here!
    int x,y,z;
    int e;
    
    while(1){
        cin >> e;
        if(e==0) break;
        int minval=1000000;
        for(int i=0;i<100000;i++){
            z = i*i*i;
            if(z>e) break;
            for(int j=0;j<1000000;j++){
                y = j*j;
                if(z + y>e) break;
                x = e - z - y;
                // cout << minval << " " << x << " " << y << " " << z << endl;
                minval = min(x+j+i,minval);
                
            }
        }
        cout << minval << endl;
        
    }
}

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

int main(void){
    long long e, x1, xmin;
    while(cin >> e){
        xmin=0;
        if(e == 0)  break;
        for(long i = 0; i < 1000; i++){
        for(long j = 0; j < 100; j++){
            x1 = e - i*i - j*j*j;
            if(x1 < 0)  break;
            if(xmin == 0 || xmin > (x1 + i + j))
            xmin = x1 + i + j;
        }
        }
        cout << xmin << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<climits>
using namespace std;
	int main(){
		int x,y,z,e,m,p,q,r,min;
		while(cin>>e,e){
			x=0;
			y=0;
			z=0;
			min=INT_MAX;
			for(p=0;p*p*p<=e;p++)
			if(p>z)
				z=p;
			for(int i=z;i>=0;i--){
				for(q=0;q*q<=e-i;q++)
					if(q>y)
						y=q;
				for(int j=y;j>=0;j--){
					for(r=0;r<=e-i-j;r++)
						if(r>x)
							x=r;
					for(int k=x;k>=0;k--){
						
						if(i*i*i+j*j+k==e){
							if(min>i+j+k)
							min=i+j+k;
						}
						
						
					}
				}
			}
			cout<<min<<endl;
		}
		return 0;
	}

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

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int inf = 1000000000;
const int mod = 1000000007;
const double eps = 1e-9;
const int dx[] = { -1, 0, 1, 0};
const int dy[] = { 0, -1, 0, 1};

int main() {
	int e;
	while (cin >> e, e) {
		int ans = inf;
		for (int z = 0; z * z * z <= e; ++z) {
			int y = floor(sqrt(e - z * z * z));
			ans = min(ans, (e - (y * y + z * z * z)) + y + z);
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE 100100
#define NIL -1
#define MAX_N 100100

double sq(double num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll e;

int main(){
	while (cin >> e&&e) {
		ll sum = INF;
		for (ll k = 0; k*k*k <= e;k++) {
			for (ll j = 0; j*j + k*k*k <= e; j++) {
				ll i = e - (j*j + k*k*k);
				if (sum > i + j + k)sum = i + j + k;
			}
		}
		cout << sum << endl;
	}
}

C++: #include<iostream>

int main(){
	int e;
	while(1){
		std::cin >> e;
		if(!e)break;
		int m = 1000001;
		for(int i=0;i*i*i<=e;i++){
			for(int ii=0;i*i*i + ii*ii<=e;ii++){
				int x = e-i*i*i-ii*ii;
				int tmp = i+ii+x;
				if(tmp < m) m = tmp;
			}
		}
		std::cout << m << std::endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int E,Count;
int solve(int E);

int solve(int E) {
  int x,y,z;
  int min = E;
  for (z=0;z*z*z<=E;z++) {
    for (y=0;y*y<=E-z*z*z;y++) {
      x = E-z*z*z-y*y;
      Count++;
      if (x>=0 && x+y+z<min) {
	min = x+y+z;
      }
    }
  }
  return min;
}
int main() {
  while (cin >> E && E>0) {
    cout << "min  : " << solve(E) << endl
	 << "count: " << Count << endl;
  }
}

C++: #include <iostream>
using namespace std;
int e;
int main(){
  while (cin >> e && e > 0){
    int m = e;
    for (int z=0; z<100; ++z){
      for (int y=0; y<1000; ++y){
	int x = e - y * y - z * z * z;
	if (0 > x){
	  break;
	}
	if (m > x + y + z){
	  m = x + y + z;
	}
      }
    }
    cout << m << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, -1, 0, 1 , 1,  1, -1, -1 };

int n;

int main() {
	while ( ~scanf( "%d", &n ) && n ) {
		for ( int i = 0; i <= n; i++ ) {
			for ( int j = 0; j <= n; j++ ) {
				for ( int k = 0; k <= n; k++ ) {
					if ( i + j * j + k * k * k > n ) {
						break;
					}
					if ( i + j * j + k * k * k == n ) {
						printf( "%d\n", i + j + k );
						goto case_end;
					}
				}
			}
		}
	case_end:;
	}
	return 0;
}