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>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;

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

    while (true) {
        int n; cin >> n;
        if (!n) break;

        int ans = INF;
        for (int z = 0; z*z*z <= n; z++) {
            for (int y = 0; y*y <= n; y++) {
                int x = n - (z*z*z+y*y);
                if (x>=0) {
                    // cout << x << " " << y << " " << z << endl;
                    ans = min(ans, x+y+z);
                }
            }
        }

        cout << ans << endl;
    }
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef std::priority_queue<int> IntPrioQueue; //Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue; //A->Z

const int MAX = 200000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const int MOD = 1000000007;

int dx4[4]={1,0,-1,0};
int dy4[4]={0,1,0,-1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

void solve(void){
    while (1) {
        int e; scanf("%d\n", &e);
        if (!e) break;
        int ans = INF;
        for (int z = 0; z * z * z <= e; z++) {
            for (int y = 0; y * y + z * z * z <= e; y++) {
                ans = min(ans, e - z * z * z - y * y + y + z);
            }
        }
        printf("%d\n", ans);
    }
}

int main(void){
  solve();
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

int main() {
  const int N = 1000000;
  int table[N+1];
  REP(i,N+1)
    table[i] = INF;
  REP(i,1001) {
    for (int j=0; i*i+j*j*j<=N; ++j) {
      table[i*i+j*j*j] = min(table[i*i+j*j*j], i+j);
    }
  }

  int n;
  while(cin>>n,n) {
    REP(i,n+1) {
      if (table[n-i] != INF) {
        cout << table[n-i] + i << endl;
        break;
      }
    }
  }
}

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

const int inf = 1e9;

using namespace std;

int main()
{
    int e;
    
    while (scanf("%d", &e), e) {
        int mi = inf;

        for (int z = 0; z * z * z <= e; ++z) {
            int y = sqrt(e - z * z * z);
            int x = e - y * y - z * z * z;
            mi = min(mi, x + y + z);
        }

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

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
 
#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define between(a,x,b) ((a)<=(x)&&(x)<=(b))
#define INF 1 << 30
 
using namespace std;
 
int main(){
  int e;
  while(scanf("%d", &e) && e){
    int res = INF;
    for(int i = 0; i * i * i <= e; i++){
      int z = i;
      int y = sqrt(e-z*z*z);
      int x = e-(y*y+z*z*z);
      res = min(res, z + y + x);
    }
 
    printf("%d\n", res);
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main() {
	int e;
	while (scanf("%d", &e), e) {
		int m = 10000000;
		for (int y = 0; y <= 1000; y++) {
			for (int z = 0; z <= 1000; z++) {
				int x=e + y - y * y + z - z * z * z;
					if(x>=0&&e>=y*y+z*z*z) m = min(x,m);
			}
		}
		cout<<m<<endl;
	}
}

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

using namespace std;

int count = 0; // ?¨???¬??¨ global ?????°
int solve(int E) {
	::count = 0;
	int ans = numeric_limits<int>::max(); // ?????§???
	for (int y=0; y*y<=E; ++y){
		for (int z=0; z*z*z<=E; ++z){
			++::count;
			int x = (int)round(E-y*y-z*z*z);
			if (x+y*y+z*z*z == E)
				ans = min(ans, x+y+z);
		}
	}
	return ans;
}
int main() {
	int E;
	while (cin >> E && E>0) {
		cout << solve(E) << endl;
		// cout << "case: m = " << E << " count: " << ::count << endl;
	}
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#define MAX (2000000)
#define INF (1145141919)
using namespace std;

int dp[MAX + 1];

int main()
{
	dp[0] = 0;
	for (int i = 1; i <= MAX; i++){
		dp[i] = INF;
	}
	
	for (int i = 1000000; i >= 0; i--){
		if (dp[i] < INF){
			for (int x = 0; x <= 1000000; x++){
				dp[i + x] = min(dp[i + x], dp[i] + x);
			}
		}
	}
	
	for (int i = 1000000; i >= 0; i--){
		if (dp[i] < INF){
			for (int y = 0; y <= 1000; y++){
				dp[i + y * y] = min(dp[i + y * y], dp[i] + y);
			}
		}
	}
	
	for (int i = 1000000; i >= 0; i--){
		if (dp[i] < INF){
			for (int z = 0; z <= 100; z++){
				dp[i + z * z * z] = min(dp[i + z * z * z], dp[i] + z);
			}
		}
	}
	
	int e;
	while (scanf("%d", &e), e){
		printf("%d\n", dp[e]);
	}
	
	return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cassert>

using namespace std;


bool solve(){
	int n;
	cin>> n;
	if(!n) return false;
	int ans = 1000000;
	for(int k=0;k*k*k<=n;k++){
		for(int j=0;j*j+k*k*k<=n;j++){
			int i = n - j*j - k*k*k;
			if(0 <= i && i <= n){
				int m = i+j+k;
				ans = min(ans, m);
			}
		}
	}
	cout<< ans<< endl;
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	while(solve());

	return 0;
}

C++: #include <stdio.h>
#include <algorithm>
 
using namespace std;
 
int e;
 
int main()
{
    while (true)
    {
        scanf("%d", &e);
 
        if (e == 0) break;
 
        int ret = 999999999;
 
        for (int z = 0; z * z * z <= e; z++)
        {
            for (int y = 0; y * y + z * z * z <= e; y++)
            {
                ret = min(ret, e - y * y - z * z * z + y + z);
            }
        }
 
        printf("%d\n", ret);
    }
}

C++: #include <iostream>

using namespace std;

int main() {
	int e;

	while (cin >> e && e > 0) {
		int min = 100000000;

		for (int z = 0; z <= 100; z++) {
			if (z * z * z > e) {
				break;
			}
			for (int y = 0; y <= 1000; y++) {
				if ((z * z * z) + (y * y) > e) {
					break;
				}
				else {
					if (min > z + y + (e - ((z * z * z) + (y * y)))) {
						min = z + y + (e - ((z * z * z) + (y * y)));
					}
				}
			}
		}

		cout << min << endl;
	}

	return 0;
}