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 main(void) {
	int e;
	while(1) {
		cin >> e;
		if(e == 0) {
			break;
		}
		
		int tmpx, tmpy, tmpz, tmpe;
		tmpe = e;
		tmpz = pow(e, 1.0 / 3.0);
		tmpe = tmpe - pow(tmpz, 3);
		if(tmpe == 0){
			tmpy = 0; tmpx = 0;
		}else{
			tmpy = pow(tmpe, 1.0 / 2.0);
			tmpe = tmpe - pow(tmpy, 2);
			if(tmpe == 0){
				tmpx = 0;
			}else{
				tmpx = tmpe;
			}
		}
		int tmpm = tmpx + tmpy + tmpz;

		int tmp, m = 100000;
		for(int z = 0; z <= tmpz; z++) {
			for(int y = 0; y <= min(tmpm - z, int(pow(e - pow(z, 3), 1.0 / 2.0))); y++) {
				int x = e - pow(y, 2) - pow(z, 3);
				tmp = x + y + z;
				if(tmp < m) {
					m = tmp;
				}
			}
		}

		cout << m << endl;
	}
	return 0;
}

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

C++: #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
#define TO(x,t,f) ((x)?(t):(f))
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define FILV(x,a) fill(x.begin(),x.end(),a)
#define FILA(ar,N,a) fill(ar,ar+N,a)
#define NEXTP(x) next_permutation(x.begin(),x.end())
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;else return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define pb push_back
#define pri(aa) cout<<(aa)<<endl
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
const ll INF=1e18+7;
const ll MOD=1e9+7;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll e;
	while(1){
		cin >> e;
		if(e==0)break;
		ll ans=MOD;
		FOR(i,0,e+1){
			FOR(j,0,e+1){
				ll k = e - i*i - j*j*j;
				ll m = k + i + j;
				if(k<0)break;
				if(ans>m){
					ans = m;
				}
			}
			if(i*i>e)break;
		}
		cout << ans << endl;
	}
}

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


int main(void){
    while (1) {
        int e;
        cin >> e;
        if (e == 0) return 0;
        
        int mn = 1e9;
        for (int i = 100; i >= 0; i--) {
            if (i * i * i <= e) {
                for (int j = e - i * i * i; j >= 0; j--) {
                    if (e - i * i * i - j * j >= 0)
                    mn = min(mn, i + j + (e - i * i * i - j * j));
                }
            }
        }
        
        cout << mn << endl;
    }
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 100;
    for (int z=0; z<=100; z++){
      //if(z >= m) break;
      for(int y=0; y<= sqrt(E-pow(z,3));y++){
	// if (y+z >= m) break;
	    int x = E - pow(z,3) - pow(y,2);
	    if (x >= 0){
	      if(x+y+z < m){
		m = x+y+z;
	      }
	    }
      }
    }
    cout << m << endl;
  }
}

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

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

C++: #include<bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i = 0;i < (n);i++)
#define rep(i,m,n) for(int i = (m);i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
#define Vec(a) vector <int> a
const int INF = 1 << 20;
const int MOD = 1e9+7;





int main(){
  ll n;
 
  while(cin >> n,n){
    ll sum = 1000000;
    REP(i,1001){
      REP(j,101){
	if(n-i*i-j*j*j >= 0){
	  sum = min(sum,(n-i*i-j*j*j)+i+j);
	}
      }
    }
    cout << sum << endl;
  }
  return 0;
}

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

using namespace std;

int main(){
    int e;
    while (true) {
        cin >> e; 
        if (!e) {break;} 
        int MIN = 2<<10;
        for (int i = 0; i*i*i <= e; i++) {
            for (int j = 0; i*i*i + j*j <= e; j++) {
                for (int k = 0; i*i*i + j*j + k <= e; k++) {
                    if (e != i*i*i + j*j + k) {continue;}
                    MIN = min(i+j+k, MIN);
                } 
            } 
        }
        cout << MIN << endl;
    }

    return 0;
}

C++: #define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};

int main() {
	for (;;) {
		int e; cin >> e;
		if (e == 0) break;
		int m = INT_MAX;
		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;
				if (x >= 0) m = min(m, x + y + z);
			}
		cout << m << endl;
	}
}

C++: #include<iostream>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int e,ans;
	while(cin>>e,e){
		ans=e;
		int x;
		rep(y,sqrt(e)+1){
			rep(z,pow(e,(double)1/3)+1){
				x=e-y*y-z*z*z;
				if(x<0)continue;
				ans=min(ans,x+y+z);
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
    for(;;){
        int e;
        cin >> e;
        int m = 1<<26;
        if (e == 0){return 0;}
        for(int z = 0 ; z*z*z <= e ; z++){
            for(int y = 0 ; y*y + z*z*z <= e ; y++){
                for(int x = 0 ; x + y*y + z*z*z == e ; x++){
                    if(x + y + z < m){
                        m = x + y + z;
                    }
                }
            }
        }
        cout << m << endl;
    }
}