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 <cmath>
using namespace std;

#define E 1000000

int main()
{
	int e;

	while (cin >> e && e > 0) {
		int Min = E + 1;
		

		for (int i = 0; i <= 1000; i++) {
			for (int j = 0; j <= 100; j++) {
				if (i*i + j*j*j > e)
					break;
				int s;
				s = (e - i*i - j*j*j) + i + j;
				
				Min = min(Min, s);
			}
		}
		cout << Min << endl;

	}

    return 0;
}

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

using namespace std;

int main(void) {
	int e;
	while(1) {
		cin >> e;
		if(e == 0) {
			break;
		}
		
		int tmpx, tmpy, tmpz, tmpe;
		tmpe = e;
		tmpz = pow(e, 1.0 / 3.0);
		tmpe = tmpe - pow(tmpz, 3);
		if(tmpe == 0){
			tmpy = 0; tmpx = 0;
		}else{
			tmpy = pow(tmpe, 1.0 / 2.0);
			tmpe = tmpe - pow(tmpy, 2);
			if(tmpe == 0){
				tmpx = 0;
			}else{
				tmpx = tmpe;
			}
		}
		int tmpm = tmpx + tmpy + tmpz;

		int tmp;
		for(int z = 0; z <= tmpz; z++) {
			for(int y = tmpy - 1; y <= min(tmpm - z, int(pow(e - pow(z, 3), 1.0 / 2.0))); y++) {
				int x = e - pow(y, 2) - pow(z, 3);
				tmp = x + y + z;
				if(tmp < tmpm) {
					tmpm = tmp;
				}
			}
		}

		cout << tmpm << endl;
	}
	return 0;
}

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

int main(){
  int e, zz;
  while(cin >> e, e){
    int min_c = INF;
    for(int z = 0; (zz = z * z * z) <= e; z++){
      for(int y = 0; zz + y * y <= e; y++){
        int tmp = zz + y * y;
        int x = e - tmp;
        if(x < 0) continue;
        min_c = min(min_c, x + y + z);
      }
    }
    cout << min_c << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7+1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n,m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

/*--------------------template--------------------*/


int main()
{
	while (1) {
		cin >> n;
		if (n == 0) {
			return 0;
		} else {
			ans = INF;
			for (int i = 0; i*i*i <= n; i++) {
				for (int j = 0; j*j <= n - i*i*i; j++) {
					ans = min(ans, i + j + (n - i*i*i - j*j));
				}
			}
			cout << ans << endl;
		}
	}
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int x,y,z;
int e;
int solve(){
	int minnum = 1000000;
	z=pow (e,1/3)
	y = (int)sqrt(e - pow(z, 3));
	x = (int)(e - pow(z, 3)-pow(y, 2)); 
	return x+y+z;
};
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 <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
 
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

ll int pow(int a,int b){
  int ans = 1;
  REP(i,b) ans = ans * a;
  return ans;
}


int hoge(int e){

  int num;

  REP(a,e+1){
	REP(b,e+1){
	  REP(c,e+1){
		num = a + pow(b,2) + pow(c,3);
		//		cout << num << endl;
		if(num > e) break;
		if(num == e) return (a + b + c);
		
	  }
	}
  }
  
	return -1;

}

int main(){

  int e;

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

	cout << hoge(e) <<endl;

  }
}

C++: #include <stdio.h>
#include <iostream>
#include <queue>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#define PB push_back
#define in scanf
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
using	namespace std;
void solve(){
	int e;
	while(cin >> e ,e!=0) {
	int m =1000000000;
	int x;
	REP(z,z*z*z<e){
		REP(y,y*y+z*z*z<e){
			x = e-pow(y,2)-pow(z,3);
			if(x>=0)m = min(x + y + z,m);
			
				
		}
	}
	cout << m  << endl;
	
}
}



	
int main(){
	solve();

}

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

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

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

int e = 0;

int solve(){
    int x,y,z;

    int y_max, z_max;
    for(x=0; x<=e; ++x){
        y_max = pow(e-x,0.5)+1;
        for(y=0; y<=y_max; ++y){
            z_max = pow(e - x - y*y,0.34)+1;
            for(z=0; z<=z_max; ++z){
                if((x+y*y+z*z*z) == e){
                    return x + y + z;
                }
            }
        }
    }
    return 0;
}

int main(void){
    while(true){
        std::cin >> e;
        if(e == 0) break;
        std::cout << solve() << std::endl;
    }
}

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,n) for(int i=(int)(n-1);i>=0;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define print(x) cout << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;
typedef pair<int, P> PIP;
typedef pair<ll, ll> PL;
typedef pair<P, ll> PPL;
typedef set<int> S;

#define INF INT_MAX/3
#define MAX_N 1000000001


int main(){
  cin.sync_with_stdio(false);
  int e;
  while(cin >> e, e) {
    int mini = INF;
    int i = 0;
    while(e >= i * i * i) {
      int tmp = e - i * i * i;
      int j = 0;
      while(tmp >= j * j) minch(mini, i + j + (tmp - j * j)), j++;
      i++;
    }
    cout << mini << endl;
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
    for(;;){
        int e;
        cin >> e;
        int m = 1<<26;
        if (e == 0){return 0;}
        for(int z = 0 ; z*z*z <= e ; z++){
            for(int y = 0 ; y*y + z*z*z <= e ; y++){
                for(int x = 0 ; x + y*y + z*z*z <= e ; x++){
                    if(x + y + z < m){
                        m = x + y + z;
                    }
                }
            }
        }
        cout << m << endl;
    }
}

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

int main(){
	int e;
	int x,y,z;
	int y2,z3;
	while(cin>>e,e){
		int ans=1<<30;
		for(z=0;(z3=z*z*z)<=e;z++){
			for(y=0;(y2=y*y)+z3<=e;y++){
				ans = min(ans,e-z3-y2+y+z);
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}