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>
#include<algorithm>

using namespace std;

int main(){

int e;
int x,y,z;

while(cin >> e){
if(e==0){
return 0;
}
int m;
for(int i=0;i*i<e;i++){
for(int j=0;j*j*j<e;j++){
if(e%j*j*j==0){
m=j;
}
else if(e%j*j*j!=0&&e%i*i==0){
m=i;
}
else if(e%j*j*j!=0&&e%i*i!=0){
m=e;
}
}
}
cout << m << endl;
}
return 0;
}

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

using namespace std;

int find(int e)
{
    int m = 1000000;
    for(int z=0; z<=100; z++)
    {
        int r = e - z*z*z;
        if(r<0) break;
        for(int y=0; y<=1000; y++)
        {
            int x = r - y*y;
            if(x<0) break;
            m = min(m, x+y+z);
        }
    }
    return m;
}

int main()
{
    int e;
    while(cin >> e, e) cout << find(e) << endl;
}

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

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

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

typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define DECIM8  fixed<<setprecision(8) 
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

using namespace std;
int main(void)
{
  for(;;){
    int e;
    cin >> e;
    if(!e) return 0;
    int answer=e;
    REP(z,128){
      if(z*z*z>e) break;
      REP(y,1024){
	if(z*z*z+y*y>e) break;
	answer=min(answer,e-z*z*z-y*y+y+z);
      }	
    }
    cout << answer << endl;
  }
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int e;
int main() {
	
	vector<int> ans;
	while (cin >> e, e) {
		int m=1000000;
		for (int i = 0; i <= e; ++i) {
			if (i*i*i > e) continue;
			for (int j = 0; j <= e; ++j) {
				if (i*i*i + j * j > e) continue;
				for (int k = 0; k <= e; ++k) {
					if (i*i*i + j * j + k == e) 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 <bits/stdc++.h>
using namespace std;

int main(){

  int e, cpy;

  while(cin >> e && e){

    int m = INT_MAX;

    for(int i = 0; i <= sqrt(e); i++){
      for(int j = 0; j <= pow(e, 1.0/3.0); j++){
	cpy = e - i*i - j*j*j;
	if(e == pow(i,2) + pow(j,3) + (double)cpy && cpy >= 0){
	    m = min(m,i+j+cpy);
	}
      }
    }
    cout << m << endl;

  }

 
}

C++: #include<stdio.h>
using namespace std;

int main(){
	long long sum=1000000,E;
	int y,z;
	while(scanf("%lld",&E),E){
	for(z=0;z*z*z<=E;z++)
		for(y=0;y*y<=E;y++){
		long long x = E-z*z*z-y*y;
		if(x<0)break;
		else if(sum>(x+y+z))sum=x+y+z;
		}
	printf("%lld",sum);
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define endl '\n'
#define int long long
#define lint long long
#define pii pair<int, int>
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) FOR(i, 0, n)
#define SZ(v) ((int)v.size())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define FILLINF(a) memset(a, 0x3f, sizeof(a))
#define POW(n) (1LL << (n))
#define POPCNT(n) (__builtin_popcount(n))
#define IN(i, a, b) ((a) <= (i) && (i) <= (b))
using namespace std;
template <typename T> inline bool CHMIN(T& a, T b) { if(a > b) { a = b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a, T b) { if(a < b) { a = b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(begin(a), end(a)); }
template <typename T> inline void REV(T& a) { reverse(begin(a), end(a)); }
template <typename T> inline void UNI(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <typename S, typename T> inline T LB(S& v, T a) { return *lower_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int LBP(S& v, T a) { return lower_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> inline T UB(S& v, T a) { return *upper_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int UBP(S& v, T a) { return upper_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> ostream& operator << (ostream& os, const pair<S, T>& p) { os << p.first << " " << p.second; return os; }
template <typename S, typename T> istream& operator >> (istream& is, pair<S, T>& p) { is >> p.first >> p.second; return is; }
template <typename T> ostream& operator << (ostream& os, const vector<T>& v) { for (int i = 0; i < v.size(); ++i) { if (i) os << " "; os << v[i]; } return os; }
template <typename T> istream& operator >> (istream& is, vector<T>& v) { for(T& in : v) is >> in; return is; }
template <typename T = int> 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 V> typename enable_if<is_class<T>::value == 0>::type fill_v(T& t, const V& v) { t = v; }
template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T& t, const V& v) { for(auto &e : t) fill_v(e, v); }
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;
const lint INF = 0x3f3f3f3f3f3f3f3f;
const lint MOD = 1000000007;

void _main() {
    int e;
    while (cin >> e, e) {
        int ans = INF;
        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;
                if (x >= 0) CHMIN(ans, x + y + z);
            }
        }
        cout << ans << endl;
    }
}

signed main(signed argc, char **argv) {
    if (argc > 1) {
        if (strchr(argv[1], 'i')) freopen("input.txt", "r", stdin);
        if (strchr(argv[1], 'o')) freopen("output.txt", "w", stdout);
    }
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}