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;

#define E 1000000

int main()
{
	int e;
	int r[10000];
	int num = 0;

	while (cin >> e && e > 0) {
		int min = E + 1;
		int e_i, e_j;

		e_i = 1000;
		e_j = 100;
		for (int i = 0; i < e_i; i++) {
			for (int j = 0; j < e_j; j++) {
				if (i*i + j*j*j > e)
					break;
				int s;
				s = (e - i*i - j*j*j) + i + j;
				
				if (s < min)
					min = s;
			}
		}

		r[num] = min;
		num++;

	}

	for (int i = 0; i < num; i++) {
		cout << r[i] << 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){
			min=INT_MAX;
			x=0;
			y=0;
			z=0;
			for(p=0;p*p*p<=e;p++)
			if(p>z)
				z=p;
			for(q=0;q*q<=e;q++)
					if(q>y)
						y=q;
			for(r=0;r<=e;r++)
						if(r>x)
							x=r;
			for(int i=z;i>=0;i--){
				for(int j=y;j>=0;j--){
					for(int k=0;k<=x;k++){
						if(i*i*i+j*j+k==e){
							if(min>i+j+k)
							min=i+j+k;
							break;
						}
					}
				}
			}
			cout<<min<<endl;
		}
		return 0;
	}

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

int main(){
	int e;
	cin >> e;
	while(e!=0){
		int Min = 1000000;
		for(int i=0; i<e+1; i++){
			int z = i;
			if(z*z*z > e){
				break;
			}
			int y = 0;
			int x = 0;
			while( (y+1)*(y+1) <= e-z*z*z ){
				y++;
			}
			x = e-z*z*z-y*y;
			if(Min > x+y+z){
				Min = x+y+z;
			}
		}
		cout << Min << endl;
		cin >> e;
	}
}

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

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion


int main()
{
    int e;
    while(cin>>e, e) {
        int m = INF;
        for(int z=0; z<=e; ++z) {
            for(int y=0; y<=e; ++y) {
                int x = e - pow(y,2) - pow(z,3);
                if(x<0) break;
                m = min(m, x+y+z);
            }
        }
        cout << m << endl;
    }
    return 0;
}

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

int main() {
    int e;
    while(cin >> e, e) {
        int mini = 2 << 28;
        for(int i = 0; i * i * i <= e; i++) {
            int z = i * i * i;
            for(int j = 0; j * j <= e - z; j++) {
                mini = min(mini, i + j + (e - z - j * j));
            }
        }
        cout << mini << endl;
    }
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>

#define INF 999999999
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define MOD(x) (x%(mod))
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int>pi;

/*---------------------------------------------------*/

int main(){
  int n;
  while(cin>>n){
    if(n==0)break;
    int mini=INF;
    for(int y=0;y*y<=n;y++){
      for(int z=0;z*z*z<=n;z++){
	int x=n-y*y-z*z*z;
	if(x<0)continue;
	//cout<<x<<" "<<y<<" "<<z<<endl;
	mini=min(mini,x+y+z);
      }
    }
    cout<<mini<<endl;
    
  }
  return 0;
}

C++: 
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
  int x,y,z,m;
  double e;
  while(cin>>e,e){
    m=1000000;
    for(z=(int)pow(e,1.0/3.0);z>=0;z--){
      for(y=(int)pow(e-z*z*z,1.0/2.0);y>=0;y--){
	x=e-y*y-z*z*z;
	if(m>x+y+z)m=x+y+z;
      }
    }
    cout<<m<<endl;
  }
}

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;
		for(int z = 0; z <= tmpz; z++) {
			for(int y = tmpy; 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 < tmpm) {
					tmpm = tmp;
				}
			}
		}

		cout << tmpm << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  while(1){
    int e,m,x,min=1000000000;
    cin>>e;
    if(e==0)break;

    for(int z=0;z*z*z<=e;z++)  
      for(int y=0;y*y<=e-z*z*z;y++){
	  x=e-z*z*z-y*y;
	  m=x+y+z;
	  if(m<min)min=m;
	}
      cout<<min<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int N,A[10010];
int min()
{
    int i;
    int min=A[0];
    for(i=0;i<N;i++)
    {
        if(A[i]<min)
            min=A[i];
    }
    return min;
}
int max()
{
    int i;
    int max=A[0];
    for(i=0;i<N;i++)
    {
        if(A[i]>max)
            max=A[i];
    }
    return max;
}
int sum()
{
    long long sum=0;
    int i;
    for(i=0;i<N;i++)
    {
        sum+=A[i];
    }
    return sum;
}
int main()
{
    cin>>N;
    for(int i=0;i<N;i++)
    {
        cin>>A[i];
    }
    cout<<min()<<' '<<max()<<' '<<sum()<<endl;
}

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

int e;

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

    int ans = e;
    for (int z=0; z*z*z<=e; z++) {
      int z3 = z*z*z;
      for (int y=0; y*y+z3<=e; y++) {
        int y2 = y*y;
        ans = min(ans, y+z+e-y2-z3);
      }
    }

    printf("%d\n", ans);
  }
}