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 <cmath>
using namespace std;

int main(){
  int e;

  while(cin>>e,e){
    if(e==1) cout << e << endl;
    else{
      int x=e,y=pow((double)e,1.0/2.0),z=pow((double)e,1.0/3.0),m=1000001;
      for(int i=0;i<=x;i++){
        for(int j=0;j<=y;j++){
          for(int k=0;k<=z;k++){
            if(i+pow((double)j, 2.0)+pow((double)k, 3.0)==e&&m>i+j+k){
              m=i+j+k;
            }
          }
        }
      }
      cout << m << endl;
    }
  }

  return 0;
}

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

int main() {
	int e,x = 0,y = 0,z = 0,ans,n,i,j;
	while(1){
		ans = 10000000;
		cin >> e;
		if(e == 0)break;
		i = 1;
		while(1){
		if(i*i*i > e)break;
		i++;
		}
		i--;
		for(;i >= 0;i--){
			n = e;
			n -= i*i*i;
			z = i;
			if(n == 0){
				ans = min(ans,z);
				continue;
			}
		for(j = 0;j*j <= n;j++);
		j--;
		n -= j*j;
		y = j;
		if(n == 0){
			ans = min(ans, z+y);
			continue;
		}
		x = n;
		ans = min(ans,x+y+z);
		//cout << x << " " << y  << " " << z <<endl;
		}
		j = 1;
		while(1){
		if(j*j > e)break;
		j++;
		}
		j--;
		for(;j >= 0;j--){
			n = e;
			n -= j*j;
			if(n == 0){
				ans = min(ans,j);
			}
			else{
				ans = min(ans,j+n);
			}
		//cout << n << " " << j <<endl;
		}
	cout << ans << endl;
	}
	return 0;
}

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

using namespace std;

int main() {

    int e;

    while(cin >> e, e) {

        int x, y, z, m = 1 << 24;

        for(z = 0; z * z * z <= e; ++z) {
            y = floor(sqrt(e - z * z * z));
            m = min(m, (e - y * y - z * z * z) + y + z);
        }

        cout << m << endl;

    }

}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 1000;
    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 <bits/stdc++.h>

using namespace std;

int main() {

    int e;

    while(cin >> e, e) {

        int x, y, z, m = 1 << 24;

        int z_range = floor(pow(e, 1.0 / 3));
        for(z = 0; z <= z_range; ++z) {
            y = floor(sqrt(e - z * z * z));
            m = min(m, (e - y * y - z * z * z) + y + z);
        }

        cout << m << endl;

    }

}

C++: #include<iostream>
using namespace std;
int e,MIN,i,j;
main(){while(true){MIN=1<<27;cin>>e;if(!e){break;}for(i=0;i*i*i<=e;i++){for(j=0;j*j+i*i*i<=e;j++){MIN=min(MIN,i+j+e-(i*i*i+j*j));}}cout<<MIN<<endl;}}

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

int main() {
    for(;;){
        int e;
        int ans=1000000;
        cin >> e;
        if (e==0) {
            break;
        }
        for (int z=0;e-z*z*z>=0 ; z++) {
            for (int y=0; e-z*z*z-y*y>=0; y++) {
                ans=min(ans,e-z*z*z-y*y +y+z);
            }
        }
        cout<<ans<<"\n";
    }
}

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 ) {
		int ans = n;
		for ( int i = n - 1; i >= 0; i-- ) {
			if ( i * i * i > n ) {
				continue;
			}
			for ( int j = n - i * i * i; j >= 0; j-- ) {
				if ( i * i * i + j * j > n ) {
					continue;
				}
				ans = min( ans, i + j + ( n - ( i * i * i + j * j ) ) );
			}
		}
		printf( "%d\n", ans );
	}
	return 0;
}

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

int main(int argc, char *argv[])
{
    int x, y, z, e, m, z3, y2;
    while (cin >> e, e) {
        m = 1000000;
        for (int z = 0; z <= 100; ++z) {
            z3 = z*z*z;
            if (z3 > e)
                break;
            for (int y = 0; y <= sqrt(e - z3); ++y) {
                y2 = y*y;
                for (int x = 0; x <= e - (y2+z3); ++x) {
                    if (x + y2 + z3 == e) {
                        m = min(m, x + y + z);
                        break;
                    }
                }
            }
        }
        cout << m << endl;
    }
    return 0;
}

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

void f(int n){
  int ans=10000000;
  for(int i=0;i*i*i<=n;i++){
    for(int j=0;i*i*i+j*j<=n;j++){
      int k=n-i*i*i-j*j;
      if(k<0) continue;
      ans=min(ans,i+j+k);
    }
  }

  cout<<ans<<endl;
}

main(){
  int n;
  while(true){
    cin>>n;
    if(n==0) break;
    f(n);
  }
}