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<algorithm>
#include<math.h>
#define MAX 10000
using namespace std;
void minn(int e)
{
    int t=0;
    int mi[MAX]={0};
    for(int z=0;z<=pow(e,1.0/3);z++)
        for(int y=0;y<=pow(e-z*z*z,1.0/2);y++)
        {
            int x=e-z*z*z-y*y;
            //cout<<x<<y<<z<<endl;
            mi[t++]=x+y+z;
        }
     sort(mi,mi+t);
     cout<<mi[0]<<endl;
}
int main()
{
    int e;
    while(cin>>e)
    {
        if(e==0)
            break;
        minn(e);
    }
    return 0;
}

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


int main() {
	int e;
	while (cin >> e; e>0) {
		int y=0;
		int z=0;
		int sum=0,summin=e; // min: NOTICE how we initialize it

		while (y**3+z**3<e) {
			while (y**3+z**3<e) {
				x= e-y**3+z**3;	
				sum = x+y+z;
				if (sum < summin) summin = sum;
				++z;
			}
			++y;
		}
		cout << summin << endl;
	}

	return 0;
}

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

using ll=long long;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)

int read(){
	int i;
	scanf("%lld",&i);
	return i;
}

signed main(){
	while(true){
		int e=read();
		int ans=100000;
		int m;
		if(e==0) break;
		int z,y,x;
		for(z=1;z*z*z<e;z++){
		}
		for(y=1;y*y<e;y++){
		}
		for(int i=0;i<=z;i++){
			for(int j=0;j<=y;j++){
				for(x=0;x+j*j+i*i*i<=e;x++){
					if(x+j*j+i*i*i == e) ans = min(ans,x+j+i);
				}
			}	
		}
		
		cout << ans << endl;
		
	}
	
}

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

int main() {
  int x, y, z, e, ans;
  while(cin >> e && e>0){
  ans =1000000;
  for (z = 0; z*z*z <= e; z++)
    for (y = 0; (x = e - y*y+z*z*z) >= 0; y++)
      if (x + y + z < ans) ans = x + y + z;
  cout << ans << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (ll)(1E9+7)
#define PI 3.1415926535897932384

template <class T>ostream &operator<<(std::ostream &o, const vector<T> &v)
{
	rep(i, v.size()) {
		o << (i > 0 ? " " : "") << v[i];
	}
	return o;
}



int main() {
	int e,n=1000000;
	while (1) {
		cin >> e;
		int min = INF;
		if (e == 0) break;
		for (int i = 0; i < e; i++) {
			for (int j = 0; j < e; j++) {
				if (i*i + j*j*j > e) continue;
				int x = e - (i*i + j*j*j);
				if (min > (i + j + x)) {
					min = i + j + x;
				}
			}
		}
		cout << min << endl;
	}
}

C++: #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int E;
    cin >> E;
    while(E){
        ll mini = INF;
        rep(i,0,1000)rep(j,0,100){
            ll x = i * i + j * j * j;
            if(x <= E)mini = min(mini, i + j + (E - x));
        }
        cout << mini << endl;
        cin >> E;
    }
}

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

int main() {
  int e;
  while (cin >> e, e != 0) {
    int m = 1000000;
    for (int z = 0; z * z * z <= e; z++) {
      int y = (int)sqrt(e - z * z * z);
      m = min(m, (e - z * z * z - y * y) + y + z);
    }

    cout << m << endl;
  }

  return 0;
}

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

int main() {
	int e, m, a, x;
	double c, d;
	while (true) {
		cin >> e;
		if (e == 0) break;
		m = 90000000;

		c = pow(e, 1.0 / 3.0);
		d = sqrt(e);
		for (int z = 0; z <= c + 100; z++) {
			for (int y = 0; y <= d; y++) {	
				x = e - y*y - z*z*z;
				if (x < 0) break;
				else {
					a = x + y + z;
					if (a < m) m = a;
				}
			}
		}

		cout << m << endl;
	}
	return 0;
}

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

int e,m;

int main(){
  int i,j,k,max;
  while(1){
    cin >> e;
    if(e==0)break;
    m = inf;
    max = sqrt(e);
    for(i=0;i<e;i++)for(j=0;j<=max;j++)for(k=0;k<max;k++){
	  if(i+j*j+k*k*k>e)break;
	  if(i+j*j+k*k*k==e&&m>i+j+k)m=i+j+k;
	}
    cout << m << endl;
  }
  return 0;
}

C++: // AOJ 2012

#include <iostream>

using namespace std;

int main(void)
{
	int e;
	while (cin >> e, e){
		int minnum = 1001001;

		for (int i = 0; i <= 100; i++){
			for (int j = 0; j <= 100; j++){
				for (int k = 0; k <= 100; k++){
					if (i + (j * j) + (k * k * k) == e){
						minnum = min(minnum, i + j + k);
					}
				}
			}
		}

		cout << minnum << endl;
	}

	return 0;
}

C++: #include<iostream>

int main(void) {
    int e = 0;
    while(std::cin >> e) {
        int result = 1000000;
        if(e == 0) {
            break;
        }
        for(int z = 0; z <= 100; z++) {
            const int Z = z*z*z;
            if(Z > e) {
                break;
            }
            for(int y = 0; y <= 1000; y++) {
                const int Y = y*y;
                if(Z + Y > e) {
                    break;
                }
                int X = e - Z - Y;
                result = std::min(result, X + Y + Z);
            }
        }
        std::cout << result << std::endl;
    }
    std::cout << 0 << std::endl;
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i ++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PL;
typedef pair<int,int> P;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const vector<int> dy = {-1,0,1,0};
const vector<int> dx = {0,1,0,-1};

void solve(int E) {
    int ans = INF;
    for (int i = 0; i*i*i <= E; i ++) {
        for (int j = 0; i*i*i + j*j <= E; j++) {
            int x = E - i*i*i - j*j;
            if (x >= 0) ans = min(ans,x + i + j);
            else break;
        }
    }
    cout << ans << endl;
}

int main() {
    while (1) {
        int E; cin >> E;
        if (E == 0) return 0;
        solve(E);
    }
}

C++: #include <iostream>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>

using namespace std;

int main(int argc, char const* argv[])
{
    int e;
    while (cin >> e, e) 
    {
        int x,y,z;
        int m = 1000000;

        //for (int i = 0; i <= e; i++) 
        //{
        //    for (int j = 0; j*j <= e; j++) 
        //    {
        //        for (int k = 0; k*k*k <= e; k++) 
        //        {
        //            //cout << " x y z = " << i << j << k <<endl;
        //            if ( i + j*j + k*k*k == e) 
        //            {
        //                m = min( m, i + j + k);
        //            }
        //        }
        //    }
        //}
        for (int k = 0; k*k*k <= e; k++) 
        {
            for (int j = 0; j*j <= e; j++) 
            {
                for (int i = 0; i <= e; i++)
                {
                    if ( i + j*j + k*k*k == e) 
                    {
                        m = min( m, i + j + k);
                    }
                }
            }
        }
        cout << m << endl;
    }
    return 0;
}