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 <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)

int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int n ;
  while(cin>>n,n){
    int ans = n;
    for(int i = 0 ; i*i*i <= n ; i ++){
      int  j = sqrt(n - i*i*i);
      if(n < i*i*i + j*j)
	continue;
      ans = min(ans,i+j+(n-i*i*i-j*j));
    }
    cout<<ans<<endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
int INF = 10000000;
int main(){
  while (1){
    int e;
    cin >> e;
    if (e == 0){
      break;
    }
    int ans = INF;
    for (int y = 0; y * y <= e; y++){
      for (int z = 0; y * y + z * z * z <= e; z++){
        int x = e - y * y - z * z * z;
        ans = min(ans, x + y + z);
      }
    }
    cout << ans << endl;
  }
}

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

using namespace std;

int main(){
    int e;
    while (true) {
        cin >> e; 
        if (!e) {break;} 
        int MIN = 2<<10;
        for (int i = 0; i <= e; i++) {
            for (int j = 0; i + j*j <= e; j++) {
                for (int k = 0; i + j*j + k*k*k <= e; k++) {
                    if (e != i + j*j + k*k*k) {continue;}
                    MIN = min(i + j + k, MIN);
                } 
            } 
        }
        cout << MIN << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;
 
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int
 
#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))
 
typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;
 
typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;
 
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;
 
namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}
 
signed main() {
    int m;
    while(cin >> m, m) {
        int mi = INF;
        repq(i,0,100) repq(j,0,1000) {
            int x = i*i*i + j*j;
            if(x > m) continue;
            else {
                int y = m - x;
                // printf("i = %lld, j = %lld, y = %lld\n", i, j, y);
                mi = min(mi, i + j + y);
            }
        }
        cout << mi << endl;
    }
    return 0;
}

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=round(pow((double)e,1.0/2.0)),z=round(pow((double)e,1.0/3.0)),m=x;
      cout << z << endl;

      for(int i=0;i<=y;i++){
        for(int j=0;j<=y;j++){
          for(int k=z;k>=0;k--){
            if(i+(int)pow((double)j, 2.0)+(int)pow((double)k, 3.0)==e&&m>i+j+k){
              m=i+j+k;
              break;
            }else if(i+(int)pow((double)j, 2.0)+(int)pow((double)k, 3.0)>e){
              break;
            }
          }
          if(i+(int)pow((double)j, 2.0)>e) break;
        }
      }
      cout << m << endl;
    }
  }

  return 0;
}

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 = 100000; i >= 0; i--){
		if (dp[i] < INF){
			for (int x = 0; x <= 100000; x++){
				dp[i + x] = min(dp[i + x], dp[i] + x);
			}
		}
	}
	
	for (int i = 100000; 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 = 100000; 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 <algorithm>
#include <cmath>
using namespace std;

#define INF 1e9

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

    int y, sum, nmin = INF;
    for(int i=0; i*i*i<=e; i++){
      sum = e - i*i*i;
      y = sqrt(sum);
      sum -= y*y;
      nmin = min(nmin, sum + y + i);
    }
    cout << nmin << endl;
  }
  
  return 0;
}

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 = 100000; i >= 0; i--){
		if (dp[i] < MAX){
			for (int x = 0; x <= 100000; x++){
				dp[i + x] = min(dp[i + x], dp[i] + x);
			}
		}
	}
	
	for (int i = 100000; i >= 0; i--){
		if (dp[i] < MAX){
			for (int y = 0; y <= 1000; y++){
				dp[i + y * y] = min(dp[i + y * y], dp[i] + y);
			}
		}
	}
	
	for (int i = 100000; i >= 0; i--){
		if (dp[i] < MAX){
			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 "bits/stdc++.h"
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cout << #x << " : " << (x) << " --------------" << endl;
using namespace std;

int main(void){
    int e;
    while (cin >> e, e) {
        int m = 1000000;
        for (int z = 100; z >= 0; --z) {
            int val = z * z * z;
            if (val > e) continue;
            int y = sqrt(e-val);
            m = min(m, (e - val - y * y) + y + z);
        }
        cout << m << endl;
    }
    return EXIT_SUCCESS;
}

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

int main(int argc, char const *argv[]) {
	int count = 1000000;
	for (int i = 0; i < count; i++) {
		int e = 0;
		cin >> e;
		if (e == 0){
			return 0;
		}
		int min = e;
		for (int z = 0; z*z*z <= e; z++) {
			for (int y = 0; y*y <= e - z*z*z; y++) {
				int x = e - y*y - z*z*z;
				int m = x + y + z;
				if (m < min){
					min = m;
				}
			}
		} //
		cout << min << endl;
	} //
	return 0;
}