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 <vector>
#include <string>
#include <stack>
#include <cstdio>
#define rep(i, j) for(int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
using namespace std;
int main()
{
	int e; while (cin >> e && e != 0)
	{
		int m = 214214, x = 0;
		rep(z, 100) rep(y, 1000)
		{
			x = e - (y * y + z * z * z);
			if (e == x + (y * y) + (z * z * z) && x >= 0) { m = min(x + y + z, m); }
		}
		printf("%d\n", m);
	}
	return 0;
}

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

const int INF = 99999999;

int main(void) {

  int e, t;
  vector<int> y2, z3;
  for (t = 0; t*t <= 1000000; t++) y2.push_back(t*t);
  for (t = 0; t*t*t <= 1000000; t++) z3.push_back(t*t*t);

  while (cin >> e, e) {
    int m = INF;
    for (int i = 0; i < y2.size(); i++) {
      for (int j = 0; j < z3.size(); j++) {
        if (y2[i]+z3[j] <= e) {
          m = min(m, (e-y2[i]-z3[j])+i+j);
        }
      }
    }
    cout << m << endl;
  }

  return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll e;
  while(cin >> e && e){
    ll m = inf;
    for(int i = 100; i >= 0; -- i){
      for(int j = 0; int(e - pow(i,3) - pow(j,2)) >= 0; ++ j){
        ll x = e - pow(i,3) - pow(j,2) ;
        if(x >= 0 && x <= 1000000){
          m = min(m,i+j+x);
        }
      }
    }
    cout << m << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define P pair<int, int>
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())

int E;

int calc(){
  int ans = 1000000;
  REP(x, 1000000){
    REP(y, 1000){
      REP(z, 100){
        //if((int)(pow(z, 3)) + (int)(pow(y, 2)) + x == E) ans = min(ans, x + y + z);
        if((int)(pow(z, 3)) + (int)(pow(y, 2)) + x == E) return x + y + z;
      }
    }
  }
  //return ans;
  return 0;
}

int main() {
  while(cin >>E && E) cout <<calc() <<endl;
  return 0;
}

C++: using namespace std;

vector<int> ans;

int main(){
	while(1){
		int e;
		cin >> e;
		if(e == 0) break;
		int m = 1e9;
		for(int i = 0;i < e;i++){
			if(i*i*i > e) break;
			int iii = i*i*i;
			for(int j = 0;j < e - iii;j++){
				if(j*j > e - iii) break;
				int jj = j*j;
				int k = e - jj - iii;
				m = min(m,i+j+k);
			}
		}
		ans.push_back(m);
	}
	for(int i = 0;i < ans.size();i++)cout << ans[i] << endl;
	
	return 0;
}

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

int main(){
int e,x,y,z,min=INF;

while(1){
cin >> e;
if(e == 0)break;

for(z=0;z*z*z<=e;z++){
y=(int)sqrt((double)(e-z*z*z));
x = e-z*z*z-y*y;

min = (min > x+y+z)?x+y+z:min;
}

cout << min;
}
return 0;
}

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

int main() {

	int E,X,tempmin;
	int min;

	while(true) {
		cin >> E;
		if(E == 0) {
			break;
		}
		min = 1000000;
		for(int Z = 0; pow(Z,3.0)<=E; Z++) {
			for(int Y = 0; pow(Y,2.0)<=(E-pow(Z,3.0)); Y++) {
				X = E-pow(Y,2.0)-pow(Z,3.0);
				tempmin = X+Y+Z;
				//cout << X << " " << Y << " " << Z << endl;
				//cout << tempmin << endl;
				if((tempmin<min) && (X+pow(Y,2.0)+pow(Z,3.0) == E)) {
					min = tempmin;
					
				}
			}
		}
		cout << min << endl;

	}
	return 0;
}

C++: #include <iostream>

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

int main(void) {
    int e;
    int temp_e;
    int min;
    while (1) {
        std::cin >> e;
        if (e == 0) {
            break;
        }
        min = 1e09;
        for (int z = 100; z >= 0; z--) {
            temp_e = e;
            int z_3 = z * z * z;
            if (z_3 > temp_e) {
                continue; 
            } else {
                temp_e -= z_3;
            }

            for (int y = 1000; y >= 0; y--) {
                temp_e = e - z_3;;
                int y_2 = y * y;
                if (y_2 > temp_e) {
                    continue; 
                } else {
                    temp_e -= y_2;
                }
                int x = temp_e;
                if (x + y + z < min) {
                    min = x + y + z; 
                }
            }
        }
        cout << min << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int e;
    while(cin >> e, e != 0){
        int minV = 1000000;
        for(int i=e; i>=0; i--){
            for(int j=e; j>=0; j--){
                for(int k=e; k>=0; k--){
                    if(i*i*i+j*j+k == e){
                        minV = min(minV, i+j+k);
                        break;
                    }
                }
            }
        }
        cout << minV << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 100;
    for (int z=0; z<=100; z++){
      if(z > m) break;
      for(int y=0; y<= sqrt(E-pow(z,3));y++){
      if (y+z > m) break;
	    int x = E - pow(z,3) - pow(y,2);
	    if (x >= 0){
	      if(x+y+z < m){
		m = x+y+z;
	      }
	    }
	  }
    }
    cout << m << endl;
  }
}

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

int main(){
	while(1){
		long e, ans=1000000;
		
		scanf(" %ld", &e);
		if(e==0) break;
		
		for(long z=0; z*z*z<=e; ++z){
			long p=z*z*z;
			
			for(long y=0; p+y*y<=e; ++y){
				long q=y*y;
				long x=e-p-q;
				long tmp=x+y+z;	
				
				if(tmp<ans) ans=tmp;
				//printf("(%ld,%ld,%ld),%ld\n",x,y,z, tmp);	
			}
		}
		printf("%ld\n", ans);
	}
	return 0;
}