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;

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int64 e;
	while (cin >> e && e) {
	  int64 res = INF_LL;
	  for (int64 z = 0; z*z*z <= e; z++) {
	    for (int64 y = 0; y*y <= e-z*z*z; y++) {
	      chmin(res, z+y+(e-z*z*z-y*y));
	    }
	  }
	  cout << res << endl;
	}
}

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

using namespace std;

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

		int min = 1000000;
		for (int z = 0; z <= 100; z++){
			for (int y = 0; y <= 1000; y++){
				int x = e - (z *z * z) - (y * y);
				if (x >=  0 and min > x + y + z){
					min = x + y + z;
				}
				
			}
		}
		cout << min<< endl;
	}
return 0;
}

C++: #include<iostream>using namespace std;int x,y,z,e,b;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++){b=e-(y*y+z*z*z);ans=min(ans,b+y+z);}}cout<<ans<<endl;}}

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

int main(){
  int e;

  while(cin>>e,e){
    int m=e;

    for(int z=0; z*z*z<=e; z++){
      const int z3 = z*z*z;
      for(int y=0; y*y+z3<=e; y++){
        int x = e - z3 - y*y;
        if(m>x+y+z&&x>=0) m=x+y+z;
      }
    }
    cout << m << endl;
  }

  return 0;
}

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

using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
template <typename T> constexpr T inf = numeric_limits<T>::has_infinity ? numeric_limits<T>::infinity() : numeric_limits<T>::max() / 4;

#define REP(i, stop) FOR(i, 0, stop)
#define FOR(i, start, stop) for (int i = start, i##_len = stop; i < i##_len; ++i)
#define RREP(i, n) for (int i = n; i-- > 0;)
#define ALL(v) (v).begin(), (v).end()

template<typename T, typename U> istream& operator>>(istream& is, pair<T, U>& a) { return is >> a.first >> a.second; }
template<typename T> istream& operator>>(istream& is, vector<T>& a) { for (T& x : a) is >> x; return is; }

void LOG(const int& x) { cerr << x << "\n"; }
void LOG(const vector<int>& a) { for (int x : a) cerr << x << " "; cerr << "\n"; }
template<typename T, std::size_t S> void LOG(const T (&a)[S]) { REP(i, S) cerr << a[i] << " "; cerr << "\n"; }
template<typename T, std::size_t S, std::size_t R> void LOG(const T (&a)[S][R]) { REP(i, S) { REP(j, R) cerr << a[i][j] << " "; cerr << "\n"; } }

i64 ceil(i64 a, i64 b) { return (a - 1) / b + 1; }
i64 gcd(i64 a, i64 b) { while (b != 0) { i64 t = b; b = a % b; a = t; } return a; }
i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
i64 gcd(const vector<i64>& v) { return accumulate(ALL(v), 1LL, static_cast<i64(*)(i64, i64)>(gcd)); }
i64 lcm(const vector<i64>& v) { return v.empty() ? 0LL : accumulate(v.begin() + 1, v.end(), v[0], static_cast<i64(*)(i64, i64)>(lcm)); }
i64 pow(i64 x, i64 y, i64 z) { i64 a = 1; while (y > 0) { if (y & 1) a = a * x % z; x = x * x % z; y /= 2; } return a; }
i64 inv(i64 x, i64 m) { return pow(x, m - 2, m); }

#define COMP(key) [](const auto& a, const auto& b) { return a.key < b.key; }

struct InitCpp { InitCpp() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); } } initCpp;

signed main() {
  while (true) {
    i32 e;
    cin >> e;
    if (e == 0) break;
    i32 ans = inf<i32>;
    for (i32 z = 0; z * z * z <= e; ++z) {
      i32 s0 = z * z * z;
      for (i32 y = 0; s0 + y * y <= e; ++y) {
        i32 s1 = s0 + y * y;
        i32 x = e - s1;
        ans = min(ans, x + y + z);
      }
    }
    cout << ans << endl;
  }
}

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

int main(){
    int n;
    while(cin >> n, n){
        int ans = 1000000;
        for(int i=0; i < 1000000; i++){
            if(n < i || ans < i) break;
            for(int j=0; j < 1000; j++){
                if(n < i+pow(j, 2) || ans < i+j) break;
                for(int k=0; k < 100; k++){
                    if(n == i+pow(j, 2)+pow(k,3)) ans = min(ans, i+j+k);
                }
            }
        }
        cout << ans << endl;
    }
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int E;
int solve (int e) {
	int mi = e;
	for (int z = 0; z*z*z <= e ; z++) {
		for (int y = 0; y*y <= e ; y++) {
			if (e - y*y - z*z*z > 0) {
				mi = min(mi,e-y*y-z*z*z+y+z);
			}
		}
	}
	return mi;
}
int min(int a,int b) {
	if (a<b) return a;
	else return b;
}
int main() {
	while (cin >> E && E > 0 ) {
		cout << solve(E) << endl;
	}
}

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

int main(void){

  int e;

while(1){
    int ans = 1000000;
    cin >> e;
    if(e == 0) break;
    for(int x=0; x <= 200; x++){
      for(int y=0; y <= 200; y++){
	for(int z=0;z <= 99; z++){
	  if(e == x + y*y + z*z*z){
	    ans = min(ans,x+y+z);
	    //cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }
    }

    cout << ans << endl;

 }
  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; Z*Z*Z<=E; Z++) {
			for(int Y = 0; Y*Y<=(E-Z*Z*Z); Y++) {
				X = E-Y*Y-Z*Z*Z;
				tempmin = X+Y+Z;
				//cout << X << " " << Y << " " << Z << endl;
				//cout << tempmin << endl;
				if((tempmin<min) && (X+Y*Y+Z*Z*Z == E)) {
					min = tempmin;
					
				}
			}
		}
		cout << min << endl;

	}
	return 0;
}

C++: #include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  int m,n;
  while(cin>>n&&n){
    m=2000000000;
    for(i=0;(int)pow(i,3)<=n;i++)
      for(j=0;(int)pow(j,2)<=n-(int)pow(i,3);j++)
	m=min(m,n-(int)pow(i,3)-(int)pow(j,2)+i+j);
    cout<<m<<endl;
  }
  return 0;
}