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++: #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++) {
			int _e = e - z * z * z;
			int y = sqrt((double)_e), x = _e - y * y;
			m = min(m, x + y + z);
		}
		cout << m << endl;
	}
}

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 <= 1000000 && i < 101; i++) {
        for (int j = 0; i + j * j <= 1000000 && 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<cmath>

using namespace std;

int main(){
	int e;
	cin >> e;

	for(int x=0;x<=e;x++){
		for(int y=0;y<=sqrt(e)+1;y++){
			for(int z=0;z<=e/3;z++){
				if(x+y*y+z*z*z == e){
					//cout << x << " " << y << " " << z << endl;
					cout << x+y+z << endl;
					return 0;
				}
			}
		}
	}

	return 0;
}

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

int main(){
        int e,x,y,z,m,min;

        while(1) {
                min=1000000;
                cin >> e;
                if(e==0) {
                        break;
                }
                else{
                        for(y=0; y<=1000; y++) {
                                for(z=0; z<=100; z++) {
                                        x=e-z*z*z-y*y;
                                        if((min>x+y+z)&&(x>=0)) {
                                                min=x+y+z;
                                        }
                                }
                        }
                }
                cout<<min<<endl;
        }

}

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

using namespace std;

int main( void )
{
	int e;
	while(cin >> e, e) {
		int Min = 1000001, sq_y = (int)(sqrt((double)e) + 1);
		for(int z=0; z < 100; ++z) {
			int sum_z = z * z * z;
			if(sum_z > e) continue;
			for(int y=0; y < sq_y; ++y) {
				int sum_zy = sum_z + y * y;
				if(sum_zy > e) continue;
				for(int x=0; x <= e; ++x) {
					int sum_zyx = sum_zy + x;
					if(sum_zyx == e)
						Min = min(Min, z + y + x);
					else if(sum_zyx > e)
						break;
				}
			}
		}
		cout << Min << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int calcOver(int, int);
int calcM(int, int ,int);

int main() {
  while(true) {
    int e;
    cin >> e;
    if(e == 0) break;
    int y = 0;
    int z = 0;
    int maxover = 0;
    int limity = pow(e, 1.0 / 2.0);
    int limitz = pow(e, 1.0 / 3.0);
    int maxy = limity;
    int maxz = limitz;
    int minm = e;
    bool flag = false;
    //cout << limity << ":" << limitz << endl;
    for(y = limity; y >= 0; --y) {
      for(int z = limitz; z >= 0; --z) {
        if(e < calcOver(y, z)) continue;
        int m = calcM(e, y, z);
        if(m <= y + z + e) {
          //cout << m << endl;
          if(minm > m) {
            maxy = y;
            maxz = z;
            minm = m;
            if(m < y + z) break;
          }
        }
      }
    }
    //cout << maxy << ":" << maxz << endl;
    cout << (e - pow(maxy, 2) - pow(maxz, 3) + maxy + maxz) << endl;
  }
  return 0;
}

int calcOver(int y, int z) {
  return (pow(y, 2) + pow(z, 3));
}
int calcM(int e, int y, int z) {
  return (e - pow(y, 2) - pow(z, 3) + y + z);
}

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

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

  int res = e;
  for (int z = 0; z*z*z <= e; ++z)
    for (int y = 0; y*y+z <= e; ++y) {
      int x = e-(y*y+z*z*z);
      if (x < 0) continue;
      res = std::min(res, x+y+z);
    }
  printf("%d\n", res);
  return 0;
}

int main() {
  while (!testcase_ends()) {}
}

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



int main(){
	int e;
	int minimum = 0;
	cin >> e;
	while(e != 0){
		for(int z = 0; z * z * z <= e; z++){
			for(int y = 0; y * y <= e; y++){
				if(ceil(e - y * y - z * z * z) == floor(e - y * y - z * z * z)){
					minimum = min(minimum, e - y * y - z * z * z + y + z);
				}
			}
		}
		cout << minimum << endl;
		cin >> e;
	}

	return 0;
}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};
 
static const double EPS = 1e-8;

int main(){
  int e;
  while(~scanf("%d",&e)){

    int res = INF;

    for(int y=0;y*y<=e;y++){
      for(int z=0;y*y+z*z*z<=e;z++){
	res = min(res,y+z+(e-y*y-z*z*z));
      }
    }
    printf("%d\n",res);
  }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <cstdio>
#define rep(i, j) for(int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
using namespace std;
int main()
{
	int e; while (cin >> e , e)
	{
		int m = 214214, x = 0;
		rep(y, 1001) rep(z, 101)
		{
			x = e - (y * y + z * z * z);
			if (e == x + (y * y) + (z * z * z) && x >= 0 ) 
			{ m = min(x + y + z, m); }
			else if (e > x + (y * y) + (z * z * z)) { break; }
		}
		printf("%d\n", m);
	}
	return 0;
}

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

#define FOR(i, a, b) for(long long int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;



int main(void) {
	
	while (1) {
		int e;
		bool flag = true;
		int mini = INF;

		cin >> e;
		if (e == 0) {
			break;
		}
		RFOR(z, cbrt(e)+1, 0) {
			if (pow(z, 3) > e) {
				continue;
			}
			RFOR(y, sqrt(e-pow(z,3))+1, 0) {
				if (pow(y, 2) > e - pow(z, 3)) {
					continue;
				}
				
					if (mini > z + y + e - pow(z, 3) - pow(y, 2)) {
						mini = z + y + e - pow(z, 3) - pow(y, 2);
					}
					break;
				
			}
		}
		cout << mini << endl;
	}

}