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;

// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll gcd(ll a, ll b) { return __gcd(a, b); }

ll euclid(ll a, ll b, ll &x, ll &y) {
    if (b) {
        ll d = euclid(b, a % b, y, x);
        return y -= a / b * x, d;
    }
    return x = 1, y = 0, a;
}

typedef unsigned long long ull;
typedef long double ld;
ull mod_mul(ull a, ull b, ull M) {
    ll ret = a * b - M * ull(ld(a) * ld(b) / ld(M));
    return ret + M * (ret < 0) - M * (ret >= (ll)M);
}
ull mod_pow(ull b, ull e, ull mod) {
    ull ans = 1;
    for (; e; b = mod_mul(b, b, mod), e /= 2)
        if (e & 1)
            ans = mod_mul(ans, b, mod);
    return ans;
}

const ll mod = 1000000007;
struct Mod {
    ll x;
    Mod(ll xx) : x(xx) {}
    Mod operator+(Mod b) { return Mod((x + b.x) % mod); }
    Mod operator-(Mod b) { return Mod((x - b.x) % mod); }
    Mod operator*(Mod b) { return Mod((x * b.x) % mod); }
    Mod operator/(Mod b) { return *this * invert(b); }
    Mod invert(Mod a) {
        ll x, y, g = euclid(a.x, mod, x, y);
        assert(g == 1);
        return Mod((x + mod) % mod);
    }
    Mod operator^(ll e) {
        if (!e)
            return Mod(1);
        Mod r = *this ^ (e / 2);
        r = r * r;
        return e & 1 ? *this * r : r;
    }
};
// endregion

int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    cin.exceptions(cin.failbit);

    cin >> skipws;
    for (;;) {
        int e; cin >> e;
        if (!e) break;

        int ans = 0x3f3f3f3f;

        for (int i = 0; i * i * i <= e; i++) {
            int rem = e - i * i * i;
            int y = floor(sqrt((long double)(rem)));
            int x = rem - y * y;
            ans = min(ans, i + y + x);
        }
        cout << ans << endl;
    }
}

C++: #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int E;
    cin >> E;
    while(E){
        ll mini = INF;
        rep(i,0,1001)rep(j,0,101){
            ll x = i * i + j * j * j;
            if(x <= E)mini = min(mini, i + j + (E - x));
        }
        cout << mini << endl;
        cin >> E;
    }
}

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

int main(){
  int e;

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
#define _GLIBCXX_DEBUG
const int inf=1e9+7;

int coconut(int e){
    int min=inf;
    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;
            if(x+y+z<min)min=x+y+z;
        }
    }
    return min;
}

int main(){
    vin ans(10000);
    int i=0;
    while(1){
        int e;cin>>e;
        if(e==0)break;
        ans[i]=coconut(e);
        i++;
    }
    int j=0;
    while(ans[j]){
        cout<<ans[j]<<endl;
        j++;
    }
}

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

using namespace std;



int main(){

	int e;
	int x,y,z;
	int xm,ym,zm;
	int csum,msum=1000000;
	while(true){

		cin>>e;
		if(e==0) break;
		
		zm=(int) pow(e,1.0/3);
		ym=sqrt(e-pow(zm,3));
		x=e-pow(zm,3)-pow(ym,2);
		msum=x+ym+zm;
		cout<<msum<<endl;

	}	
	
	


return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  int e,m;

  while(cin >> e && e>0){
      m=e;
    for(int x=0; x<=e; x++){
      for(int y=0; pow(y,2)<=e; y++){
        for(int z=0; pow(z,3)<=e; z++){
          if(x+y*y+z*z*z==e && x+y+z<m)
            m=x+y+z;
        }
      }
    }

    cout << m << endl;
  }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int x,y,z;
int e;
int solve(){
	int minnum;
	minnum = int(sqrt(e))+e-pow(int(sqrt(e)),2);
	z=  (int)(pow (e,1/3));
	y = (int)(sqrt(e - pow(z, 3)));
	x = e - pow(z, 3)-pow(y, 2); 
	minnum = min(minnum,x+y+z);
	return minnum;
};
int main(){
	int A[100000];
    int k = 0;
	while( cin>>e && e>0 )
	{
		A[k]=solve();
        k++;
	}
	for(int l = 0;l < k; l++)
    {
        cout<<A[l]<<endl;
    }
	return 0;
}

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

using namespace std;

int main(){
	int sq[1002],cb[102];
	for(int i=0;i<=1001;i++)	sq[i]=i*i;
	for(int i=0;i<=101;i++)		cb[i]=i*i*i;

	for(int e;scanf("%d",&e),e;){
		int m=1<<30;
		for(int z=0;cb[z]<=e;z++)for(int y=0;sq[y]<=e-cb[z];y++){
			int x=e-cb[z]-sq[y];
			m=min(m,x+y+z);
		}
		printf("%d\n",m);
	}

	return 0;
}

C++: #include<bits/stdc++.h>
#define dump(a) cout << #a << "=" << a << endl
using namespace std;


int main() {
	int E;
	while(cin >> E) {
		if (E == 0) { break; }

		int min_m = INT_MAX;
		for(int z = 0; z <= 100; z++) {
			for(int y = 0; y <= 1000; y++) {
				int x = E - y*y - z*z*z;
				if (x >= 0) {
					int m = x + y + z;
					min_m = min(m,min_m);
				}
			}
		}
		cout << min_m << endl;
	}

	return EXIT_SUCCESS;
}

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

int main()
{
  int e;
  while (~scanf("%d", &e)) {
    if (e == 0)
      break;

    int ans = 1 << 30;
    for (int y = 0; y*y <= e; ++y) {
      for (int z = 0; z*z*z <= e; ++z) {
	if (y*y+z*z*z <= e)
	  ans = std::min(ans, y+z+(e-y*y-z*z*z));
      }
    }

    printf("%d\n", ans);
  }
  return 0;
}

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

using namespace std;

int main(void) {
  int e;
  while (cin >> e, e) {
    int ans = (int)1e9;
    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;
        if (x < 0) continue;
        ans = min(ans, x + y + z);
      }
    }

    cout << ans << endl;
  }

  return 0;
}

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

int main() {
	int e;
	while (cin >> e, e) {
		int m = 81671422;
		for (int x = 0; x <= e; x++) {
			for (int y = 0; x + y*y <= e; y++) {
				for (int z = 0; x + y*y + z*z*z <= e; 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 <iostream>
using namespace std;

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

    int m;
    m = e;

    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(m > x + y + z) m = x + y + z;
      }
    }
    cout << m << endl;
  }
}