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;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define digit(N) cout << fixed << setprecision((N))

ll e;

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

        ll ans = infll;
        for (ll z = 0; z * z * z <= e; z++)
        {
            for (ll y = 0; y * y <= e; y++)
            {
                if (e - y * y - z * z * z < 0)
                    break;
                ll x = e - y * y - z * z * z;
                ans = min(ans, x + y + z);
            }
        }
        cout << ans << "\n";
    }
}

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=n;k>=0;k--){
		if((long long)k*k*k > n) continue;		//long long
		for(int j=n;j>=0;j--){
			if(j*j + k*k*k > n) continue;
			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<bits/stdc++.h>
using namespace std;
int main(){
  int e;
  while(1){
    cin>>e;
    if(e==0) break;
    int i,j,k;
    for(i=0;i<=e;i++){
      for(j=0;j*j+i<=e;j++){
	for(k=0;k*k*k+j*j+i<=e;k++){
	  if(k*k*k+j*j+i==e){
	    cout<<k+j+i<<endl;
	    e=0;
	    break;
	  }
	}
	if(e==0) break;
      }
      if(e==0) break;
    }
  }	    
  return 0;
}

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

int main() {
  while(true) {
    int e; cin >> e;
    if(e == 0) break;
    int res = (int)1e9;
    for(int z = 0; z*z*z <= e; z++) {
      for(int y = 0; y*y + z*z*z <= e; y++) {
        int x = e - z*z*z - y*y;
        res = min(res, x+y+z);
      }
    }
    cout << res << endl;
  }
}

C++: #include<stdio.h>
#include<limits.h>
#include<vector>
#include<algorithm>
const int N = 1000001;
int a[N],i,j,k,m,e,V=INT_MAX;
int main()
{
	for(i=0;i<N;++i)a[i]=V;
	std::vector<int>c,s;
	for(i=0;e=i*i,e<N;++i)s.push_back(e);
	for(i=0;e=i*i*i,e<N;++i)c.push_back(e);
	for(i=0;i<s.size();++i)for(j=0;j<c.size()&&s[i]+c[j]<N;++j)e=s[i]+c[j],a[e]=std::min(a[e],i+j);
	while(scanf("%d",&e),e)
	{
		for(i=0;a[e-i]==V;)++i;
		printf("%d\n",a[e-i]+i);
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
#include<set>
using namespace std;


const long long int mod=1000000007;
const long long int INF=99999999999999999;


long long int e;
string str[25];
int main() {
	cout << fixed << setprecision(18);
	cin>>e;
	while(e!=0){
		long long int res=1000000000000000;
		for(int z=0;z*z*z<=e;z++){
			for(int y=0;z*z*z+y*y<=e;y++){
				res=min(res,(e-z*z*z-y*y)+y+z);
			}
		}
		cout<<res<<endl;
		cin>>e;
	}
}

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

int main() {
	int e;
	while (cin >> e, e) {
		int x = 0, m = 81671422;
		for (int z = 0; z*z*z <= e; z++) {
			for (int y = 0; y*y <= e - z*z*z; y++) {
				x = e - z*z*z - y*y;
				m = min(m, x + y + z);
			}
		}
		cout << m << endl;
	}
}

C++: #include <iostream>

using namespace std;

int main(void)
{
	int e;
	while(cin >> e && e > 0){
		int mini=e;
		for(int z=0;z*z*z<=e;z++){
			int z3 = z*z*z;
			int y=0, x;
			while((x = e-z3-y*y) >= 0){
				mini = min(mini, x+y+z);
				y++;
			}
		}
		cout << mini << endl;
	}
	return 0;
}

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

int main ()
{
    int e;
    while (cin >> e, e) {
        int res = 1000000;
        for (int i = 0; i <= e && i < res; i++) {
            for (int j = 0; i + j * j <= e && i + j < res; j++) {
                for (int k = 0; i + j * j + k * k * k <= e && i + j + k < res; k++) {
                    if (i + j * j + k * k * k == e) {
                        res = min(res, i + j + k);
                    }
                }
            }
        }

        cout << res << endl;
    }

    return 0;
}

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


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; 0 <= k*k*k; k++) 
        {
            int j = sqrt(e - k*k*k);
            int i = e - k*k*k -j*j;
            m = min( m, i + j + k);
        }
        cout << m << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int e;
	while(cin >> e, e){
		int MIN = INF;
		rep(i, 0, 101){
			rep(j, 0, 1001){
				int x = e - i * i * i - j * j;
				if(x < 0) break;
				chmin(MIN, i + j + x);
			}
		}
		cout << MIN << endl;
	}
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define INF 1000000
int main() {
    int e;
    vector<int> y, z;
    for (int i=0;;i++) {
        if (i*i>INF) break;
        y.push_back(i*i);
    }
    for (int i=0;;i++) {
        if (i*i*i>INF) break;
        z.push_back(i*i*i);
    }
    while (scanf("%d",&e)) {
        if (e==0) break;
        int m=INF+1;
        for (int x=0; x<=e; x++) {
            for (int i=0; i<y.size(); i++) {
                if (y[i]>e) break;
                for (int j=0; j<z.size(); j++) {
                    if (z[j]>e) break;
                    if(e==x+y[i]+z[j]) m=min(m,x+i+j);
                }
            }
        }
        printf("%d\n",m);
    }
}

C++: #include<iostream>
using namespace std;
int x,y,z,e;
main(){
while(true){
cin >> e;
if(!e)
break;
int ans = e;
for(z=0;z*z*z<=e;z++){for(y=0;y*y+z*z*z<=e;y++){int b=e-(y*y+z*z*z);ans = min(ans,b+y+z);
}
}
cout << ans <<endl;
}
}