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() {
  while (true) {
    int e, max = 0;
    cin >> e;
    if (e == 0) break;
    for (int z = 0; z <= 100; z++) {
      if (z * z * z > e) break;
      for (int y = 0; y <= 1000; y++) {
        if (y * y + z * z * z > e) break;
        else if (max < y * y - y + z * z * z - z) max = y * y - y + z * z * z - z;
      }
    }
    cout << e - max << endl;
  }
}

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

using namespace std;

int main (int argc, char *argv[]) {
    int e;
    while (cin>>e, e) {
        int m = e;
        for (int z = 0; pow(z, 3) <= e; ++z) {
            for (int y = 0; pow(y, 2) <= e - pow(z, 3); ++y) {
                int x = e - pow(y, 2) - pow(z, 3);
                m = min(m, x + y + z);
            }
        }
        cout<<m<<endl;
    }
    return 0;
}

C++: #if 0

#endif

#include <iostream>
#include <cmath>
using namespace std;

int mycount = 0; // ambigous??¨???????????????????????????
int solve(int E) {
 // ?????´????±???????
	int ans = 1000000; // ?????§???
	for (int x=0; x<=E; ++x)
		for (int y=0; y*y<=E; ++y){
			int z = (int)round(pow(E-x-y*y,1.0/3));
				++mycount; 
				if (x+y*y+z*z*z == E)
					if (x+y+z<=ans)
						ans = x+y+z;
			}
	return ans;
}
int main() {
	int E;
	while (cin >> E && E>0)
		cout << solve(E) << endl;
}

C++: #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>

using namespace std;

const int INF = (1<<30) - 1;


int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(0);
    int e;
    while(cin>>e, e){
        int ans = INF;
        for(int z=0; z*z*z<=e; z++){
            int sum = z*z*z;
            for(int y=0; y*y+sum<=e; y++){
                int x = e-y*y-sum;
                ans = min(ans, x+y+z);
            }
        }
        cout << ans << endl;
    }
    return 0;
}

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

int main(){
    while(true){
        int e;
        int min = INT_MAX;
        cin >> e;
        if(e==0) break;
        for(int z=0; z <= cbrt(e); z++){
            for(int y=0; y <= sqrt(e-z*z*z); y++){
                int tmp = z+y+(e-z*z*z-y*y);
                if(tmp < min) min = tmp;
            }
        }
        cout << min << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int e;
	while (cin >> e) {
		if (e == 0) {
			break;
		}
		int i, j, k, m;
		bool hantei = false;
		for (m = 1; ; m++) {
			if (m*m*m < e) {
				continue;
			}
			bool hantei2 = false;
			for (k = m; k >= 0; k--) {
				for (j = m-k; j >= 0; j--) {
					for (i = m-k-j; i >= 0; i--) {
						if (i+j*j+k*k*k < e) {
							hantei2 = true;
							break;
						}
						if (i+j*j+k*k*k == e) {
							hantei = true;
							break;
						}
					}
					if (hantei|| hantei2) {
						break;
					}
				}
				if (hantei || hantei2) {
					break;
				}
			}
			if (hantei) {
				break;
			}
		}
		cout << m << endl;
	}
	return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10
#define MAX_N 20000
#define MAX_M 16

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int e, m;

int main(){
	while (cin >> e&&e){
		int m = 1000001;
		for (int i = 0; i <= 100; i++){
			for (int j = 0; j <= 1000; j++){
				int x = e - i*i*i - j*j;
				if (x >= 0){
					m = min(m, x + i + j);
				}
			}
		}
		cout << m << endl;
	}
}

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

int e;

int solve(){
  int min = 100000000;
  for(int z = 0; z * z * z <= e;z++){
    int y = floor(sqrt(e - z * z * z));
    int x = e - z * z * z - y * y;
    if(z + y + x < min){
      min = x + y + z;
    }
  }
  return min;
}

int main() {
  while(cin >> e && e > 0){
    cout << solve() << endl;
  }
}

C++: //b
#include <iostream>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <memory>
#include <functional>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>

#define REP(i,b,n) for(int i=b;i<n;i++)
#define REPR(i,b,n) for(int i=n-1;i>=b;i--)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PB push_back
#define MP make_pair

using namespace std;

static const double PI = acos(-1.0);
static const double EPS = 1e-9;
typedef long long ll;
typedef pair<int, int> pii;	

int main(){
	
	ll e;
	
	while(cin>>e, e){
	
		ll mn = e;
		
		for(ll y=0; y<e; ++y){
			for(ll z=0; z<e; ++z){
				
				if( e - y*y - z*z*z >= 0){
					mn = min(mn, e - y*y - z*z*z + y + z);
				}
			}
		}
		
		cout << mn << endl;
		
	}
	
	return 0;	
}

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

using namespace std;

int main() {
  int e;
  while (true) {
    cin >> e;
    if (e == 0) break;

    int ans = 1e9;
    for (int y = 0; y <= 1000; y++) {
      for (int z = 0; z <= 100; z++) {
        int x = e - y * y - z * z * z;
        if (x < 0) continue;
        ans = min(ans, x + y + z);
      }
    }
    cout << ans << "\n";
  }

  return 0;
}

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, cnt = 0;
        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));
                }
                cnt++;
            }
            if (cnt > 3) break;
        }
        
        cout << mn << endl;
    }
}