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++: 
import java.util.Scanner;

/**
 * Created by Reopard on 2014/07/03.
 */
public class Main{
    public static void main(String[] args){
        int x, y, z, e, m, min;

        Scanner scan = new Scanner(System.in);
        while((e = scan.nextInt()) != 0){
            min = Integer.MAX_VALUE;
            for(z = 0; z*z*z <= e; ++z){
                for(y = 0; y*y + z*z*z <= e; ++y){
                    for(x = 0; x + y*y + z*z*z <= e; ++x){
                        if(x + y*y + z*z*z == e){
                            m = x + y + z;
                            min = Math.min(m, min);
                        }
                    }
                }
            }
            System.out.println(min);
        }
    }
}

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 + 1 - 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>
#include <string>
#include <map>
#include <math.h>
#include <complex>

using namespace std;

int main(){

    int e;

    while(cin>>e,e){

        int x,y,z;
        int answer = 1000000;
        /*for(int i=0;i<=e;i++){
            for(int j=0;j<=sqrt(e)-i;j++){
                for(int k=0;k<=pow(e,1.0/3.0)-i+pow(j,2.0);k++){
                    if(i+pow(j,2.0)+pow(k,3.0)==e&&answer>i+j+k){
                        answer = i+j+k;
                    }
                }
            }
        }*/

        for(int k=0;k<=pow(e,1.0/3.0);k++){
            for(int j=0;j<=sqrt(e)-k;j++){
                for(int i=0;i<=e-pow(j,2.0)+pow(k,3.0);i++){
                    if(i+pow(j,2.0)+pow(k,3.0)==e&&answer>i+j+k){
                        answer = i+j+k;
                    }
                }
            }
        }

        cout<<answer<<endl;
    }

    return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;

int main(){
  int e,minInt;
  while (true){
    scanf("%d",&e);
    if (e==0) return 0;
    minInt=10000000;
    for (int z=100;z>=0;z--)
      for (int y=1000;y>=0;y--)
        if ((e-(y*y+z*z*z))>=0)
          minInt=min(minInt,y+z+e-(y*y+z*z*z));
    printf("%d\n",minInt);
  }
}

C++: // Space Coconut Crab
#include <iostream>
using namespace std;
int count = 0; // ?¨???¬??¨ global ?????°
int solve(int E) {
  // ?????´????±???????
  int ans = E // ?????§??? 
  for (int x=0; x<=E; ++x)
    for (int y=0; y*y<=E; ++y)
      for (int z=0; z*z*z<=E; ++z) {
        ++count;
        if (x+y*y+z*z*z == E)
          if (x+y+z < ans ) // 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 <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, -1, 0, 1 , 1,  1, -1, -1 };

int n;

int main() {
	while ( ~scanf( "%d", &n ) && n ) {
		int ans = n;
		for ( int i = 0; i * i * i <= n; i++ ) {
			int j = sqrt( n - i * i * i );
			ans = min( ans, i + j + ( n - ( i * i * i + j * j ) ) );
		}
		printf( "%d\n", ans );
	}
	return 0;
}

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  while(1){
    int e;
    cin >> e;
    if(e==0) return 0;
    int ans=1000000000;
    for(int i=0;i<=100;i++){
      for(int j=0;j<=1000;j++){
        if(e>=i*i*i+j*j) ans=min(ans,i+j+e-i*i*i-j*j);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
	const int intmax  = 1000001;
	ll int e;
	while(cin >> e,e){
		ll int ans = 9999999;
		FOR(y,0,sqrt(e)+1){
			FOR(z,0,cbrt(e)+1){
				if(e-y*y-z*z*z>=0) ans = min(ans,y+z+(e-y*y-z*z*z));
			}
		}
		cout << ans << endl;
	}
	
}

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

#define EPS 1e-7

int main(){
	int e;
	while(scanf("%d", &e), e != 0){
		int ans = e;
		int k;
		for(int z = 0; (k = e - z * z * z) >= 0; ++z){
			int y = (int)(sqrt(k) + EPS);
			int x = k - y * y;
			ans = min(ans, x + y + z);
		}
		printf("%d\n", ans);
	}
}

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

static const int INF = 1000001;

int main() {
	while (true) {
		int e;
		cin >> e;
		if (e == 0) break;
		
		int i;
		for (i = 0; i * i * i <= e; i++)
			;
		int t = i - 1;
		
		int m = INF;
		for (int j = t; j >= 0; j--) {
			int tz = j * j * j;
			for (int k = 0; tz + k * k <= e; k++) {
				int ty = k * k;
				int tx = e - tz - ty;
				if (tx + k + j < m)
					m = tx + k + j;
			}
		}
		
		cout << m << endl;
	}
	return 0;
}