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 <cmath>
using namespace std;
using ll = long long;
int main(void){
	while(1){
		ll num,ans=1000000;
		cin >> num;
		if(!num)	break;
		for(ll x=0;x<=num;x++){
			for(ll y=0;y<=sqrt(num-x);y++){
				for(ll z=0;pow(z,3)<=num-x-pow(y,2);z++){
					ll kazu=x+pow(y,2)+pow(z,3);
					if(kazu>num)	break;
					if(kazu==num){
						//cout << x << ' ' << y << ' ' << z << endl;
						ans = min(ans,(x+y+z));
						break;
					}
				}
			}
		}
		cout << ans << endl;
}
	return 0;
}

C++: #include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<ll,pll> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
const int DX[8]={-1,0,1,0,-1,-1,1,1},DY[8]={0,-1,0,1,-1,1,-1,1};

const int NPrime=3000000;
bool prime[NPrime+1];
vi EnumeratePrime(){
	fill(prime+2,prime+NPrime+1,true);
	vi a;
	for(int i=2;i<=NPrime;i++) if(prime[i]){
		a.emplace_back(i);
		for(int j=2*i;j<=NPrime;j+=i) prime[j]=0;
	}
	return a;
}
int n;

string s;

int main(){
	while(1){
		cin>>n;
		if(n==0) break;
		int res=inf;
		for(int i=0;i*i*i<=n;i++) for(int j=0;i*i*i+j*j<=n;j++){
			res=min(res,i+j+n-i*i*i-j*j);
		}
		cout<<res<<endl;
	}
}

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

using namespace std;

int e;

int check(int ne){
	if(ne==0)return 0;
	int lb=0,ub=10001;
	while(ub-lb>1){
		int mid=(lb+ub)/2;
		if(mid*mid<=ne)lb=mid;
		else ub=mid;
	}
	return (ne-lb*lb+lb);
}

int main(void){
	while(1){
		scanf("%d",&e);
		if(e==0)break;
		int lb=0,ub=101;
		while(ub-lb>1){
			int mid=(lb+ub)/2;
			if(mid*mid*mid<=e)lb=mid;
			else ub=mid;
		}
		//printf("%d\n",lb);
		int res=1000000;
		for(int i=0;i<=lb;i++){
			res=min(res,i+check(e-i*i*i));
		}
		printf("%d\n",res);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
    int e;
    cin >>e;

    while(e)
    {
        int x=0;
        int y=0;
        int z=0;
        int m=0;
     for(z=0;z<=e/9;z++)
        for(y=0;y<=e/2;y++)
        {
            x = e-z*z*z-y*y;
            if(x<0)
                continue;

                int t = x+y+z;
                if(m ==0||m>t)
                    m=t;
            }

        cout <<m<<endl;




        cin >>e;
    }
    return 0;
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define REAP(i,a,n) for(int i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()
typedef long long ll;

int main(){
    ll e;
    while(cin >> e,e){
        ll m=e;
        for(int y=0;pow(y,2)<=e;y++){
            for(int z=0;pow(z,3)+pow(y,2)<=e;z++){
                if(pow(y,2)+pow(z,3)>e)break;
                m=min(m,y+z+(e-(ll)pow(y,2)-(ll)pow(z,3)));
            }
        }
        cout << m << endl;
    }
}

C++: #include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    int e;
    vector<int> ans;
    while(true){
        int res = mod;
        cin >> e;
        if(e == 0) break;
        int z_loop = 0;
        int y_loop = sqrt(e) + 1;
        int temp;
        while(z_loop*z_loop*z_loop <= e) z_loop++;
        for(int z = 0; z <= z_loop; z++){
            temp = z*z*z;
            for(int y = 0; y <= y_loop; y++){
                int x = e - temp - y*y;
                if(x >= 0) res = min(res, x+y+z);
            }
        }
        ans.push_back(res);
    }
    rep(i, ans.size()) cout << ans[i] << endl;
    return 0;
}

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

using std::cin;
using std::cout;
using std::endl;

int limit(int lim, int exp) {
	int res = 0;
	for (int i = 0; pow(i,exp) < lim+1; i++) {
		res = i;
	}
	return res;
}

int main(void) {
	int e;
	cin >> e;

	while (e != 0) {
		int m = 0;
		int res;
		int en = e;
		int temp;
		int z = limit(en,3);

		for (int i = 0; i < 15 && !((z-i) < 0); i++) {
			m = 0;
			en = e;

			m += z-i;
			en -= pow(z-i,3);

			temp = limit(en,2);
			m += temp;
			en -= pow(temp,2);

			temp = limit(en,1);
			m += temp;

			if (i == 0) {
				res = m;
			}
			else if (m < res) {
				res = m;
			}
		}
		
		cout << res << endl;
		cin >> e;
	}
	return 0;
}

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

int count = 0; // count the number of iterations
int solve(int E) {
  int ans = E;
  for (int y = 0; y*y <= E; ++y)
    for (int z = 0; z*z*z <= E; ++z){
      ++count; // Minimum number of counts when the looping is minimized; loop y and z thus.
      int x = (int) round(E-y*y-z*z*z);
      if (x + y*y + z*z*z == E && x > 0)
	ans = min(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;

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

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

int main(){
  int e;
  int m;
  int x,y,z;
  int min;
  while(1){
    min = 100000000;
    cin >> e;
    if(e == 0){
      break;
    }
    for(y = 0 ; y < 1000 ; y++){
      for(z = 0 ; z < 100 ; z++){
	x = e - (y*y) - (z*z*z);
	m = x + y +z;
	if(min > m && x >= 0 && y >= 0 && z >= 0){
	  min = m;
	}
      }
    }
    cout << min << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	long long e,best;
	while(true){
	cin>>e;
	if(e==0)
		break;
	best=e;
	for(int i=0;i*i*i<=e;i++){
		for(int j=0;j*j<=e;j++){
			if(i*i*i+j*j<=e&&i+j+e-i*i*i-j*j<best)
				best=i+j+e-i*i*i-j*j;
		}
	}
	cout<<best<<endl;
	}
    return 0;
}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
  int x,y,z,e;
  while( cin >> e ){
    int ret = 999999999;
    for(int y = 0 ; y*y <= e ; y++ ){
      for(int z = 0 ; z*z*z <= e ; z++ ){
	if(e - (y*y + z*z*z) >= 0)x = e - (y*y + z*z*z);
	  ret = min(ret,x+y+z);
      }
    }
    cout << ret << endl;
  }
  return 0;
}