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 <climits>
#include <cstdlib>
#include <iostream>
using namespace std;

template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; }

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

	for(int e; cin >> e, e;) {
		int m = INT_MAX;
		for(int z = 0; z * z * z <= e; ++z) {
			const int z3 = z * z * z;
			for(int y = 0; y * y + z3 <= e; ++y) {
				const int x = e - z3 - (y * y);
				if(x >= 0)
					chmin(m, x + y + z);
					
			}
		}

		cout << m << endl;
	}

	return EXIT_SUCCESS;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int Bsearch(int n,int e){
  if(e==1)return 1;
  int s,t;
  s=0;t=e;
  int x=e/2;
  while(t-s>1){
    if(pow(x,n)<e){
      s=x;
    }else if(pow(x,n)>e){
      t=x;
    }else{
      break;
    }
    x=(s+t)/2;
  }
  return x;
}

int main(){
  int e;
  while(cin>>e){
    if(e==0)break;
    int x=Bsearch(3,e);
    int y=Bsearch(2,e);
    int minim=1000;
    for(int i=0;i<=Bsearch(3,e);i++){
      for(int j=0;j<=Bsearch(2,e);j++){
	int x=e-pow(i,3)-pow(j,2);
	if(x<0)continue;
	minim=min(minim,i+j+x);
      }
    }
    cout << minim << endl;
  }
  return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n) for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int main(){
	long z,e,ee,res=1000000;
	while(1){
		cin >> e;
		if(e==0)
			break;

		for(int i=0; e!=0;i++){
            if(i*i*i > e){
                z = i;
                break;
            }
        }
        
        for(int i=0; i<20;i++){
            z-=1;
            ee=e;
            if(z<0){
                z=0;
            }
            ee-=z*z*z;
            if(ee==0){
                res=min(res,z);
            }
            for(int y=0;ee!=0;y++){
                if(y*y > ee){
                    ee-=(y-1)*(y-1);
					res=min(res,z+(y-1)+ee);
					break;
				}
            }
		}
        cout << res << endl;
		res=1000000;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int e;
  while(cin>>e,e){
    int ans = 1000000;
    for(int z=0;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 <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 1000000;
    for (int z=0; z<=100; z++){
      for(int y=0; y<= sqrt(E-pow(z,3));y++){
	int x = E - pow(z,3) - pow(y,2);
	if (x>=0){
	  int n = x+y+z;
	  if(n < m && m > 0){
	    m = n;
	  }
	}
      }
    }
    cout << m << endl;
  }
}

C++: #include <iostream>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>
#include <math.h>
 
 
using namespace std;
 
int main(int argc, char const* argv[])
{
    int e;
    while (cin >> e, e) 
    {
        int x,y,z;
        int m = 1000000;
 
        //for (int i = 0; i <= e; i++) 
        //{
        //    for (int j = 0; j*j <= e; j++) 
        //    {
        //        for (int k = 0; k*k*k <= e; k++) 
        //        {
        //            //cout << " x y z = " << i << j << k <<endl;
        //            if ( i + j*j + k*k*k == e) 
        //            {
        //                m = min( m, i + j + k);
        //            }
        //        }
        //    }
        //}
        for (int k = 0;  k*k*k <= e; k++) 
        {
            int j = sqrt(e - k*k*k);
            int i = e - k*k*k -j*j;
            m = min( m, i + j + k);
        }
        cout << m << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <vector>

#define el endl
#define fd fixed
#define INF INT_MAX/2-1
#define pb push_back

using namespace std;

int main() {
  int e;
  while (cin >> e, e) {
    int x = 0, y = 0, z = 0, min = INF;
    for (z = 0; z*z*z <= e; z++) {
      for (y = 0; y*y <= e - z*z*z; y++) {
        x = e-y*y-z*z*z;
        if (x+y+z < min) min = x+y+z;
      }
    }
    cout << min << el;
  }
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

using namespace std;

inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}

typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EACH(t,i,c) for(t::iretator i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

const double EPS = 1e-10;

int main() {
	int e;

	while(cin >> e, e) {
		int min = INT_MAX;	

		for(int z = 100; z >= 0; z--) {
			for(int y = sqrt((double)e-z*z*z); y >= 0; y--) {
				for(int x = e-z*z*z-y*y; x >= 0; x--) {
					if(e == x+y*y+z*z*z) {
						if(min > x+y+z) {
							min = x+y+z;
						}
					}				
				}
			}
		}

		cout << min << endl;
	}
}

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

using namespace std;

#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define INF 1000000000
#define INFL 10000000000000000LL
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

int main() {
  while(true){
    int n;
    cin >> n;
    if(n == 0) return 0;
    ll ans = INF;
    REP(i, (int)pow(n, 0.335)+1){
      REP(j, (int)pow((n-i*i*i), 0.5)+1){
        int k = n - (i*i*i) - (j*j);
        if(k >= 0 && i+j+k < ans) ans = i+j+k;
      }
    }
    cout << ans << endl;
  }
  return 0;
}