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 <cstdio>
#include <string>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
using namespace std;

#define REP(i, s, e) for (int i = (s); i < (e); i++)
#define REPI(i, s, e) for (int i = (s); i <= (e); i++)
#define rep(i, n) REP(i, 0, n)
#define repi(i, n) REPI(i, 0, n)
#define ALL(v) (v).begin(), (v).end()

#define dump(x) (cout << #x << " = " << x << endl)
#define dump2(x, y) (cout << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl)
#define dump3(x, y, z) (cout << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", "<< z << ")" << endl)

typedef long long ll;
typedef pair<int, int> pii;

#define MAX 1000000

int main(void)
{
	int e;
	vector<pii> vs;
	for (int y = 0;; y++) {
		int k = y*y;
		if (k > MAX) break;
		for (int z = 0;; z++) {
			int l = z*z*z;
			if (k+l > MAX) break;
			vs.push_back(pii(k+l, y+z));
		}
	}
	sort(ALL(vs));

	while (cin >> e, e) {
		int ans = (1<<29);
		rep(i, vs.size()) {
			int x = e-vs[i].first;
			if (x < 0) continue;
			ans = min(ans, x+vs[i].second);
		}
		cout << ans << 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>

int main() {
  while (true) {
    int minv, e;
    std::cin >> e;
    if (e == 0) break;
    minv = e;
    
    for (int z = 0; z*z*z <= e; z++) {
      for (int y = 0; y*y+z*z*z <= e; y++) {
        int v = e - y*y -z*z*z + y + z;
        if (v < minv) minv = v;
      }
    }
    
    std::cout << minv << std::endl;
  }
  
  return 0;
}

C++: #include <iostream>
#include <vector>
using namespace std;
typedef vector<int> vi;
void binarySearch(int f,int l,vi array){

}
int main(){
  
  while(true){
    int n;
    cin >> n;
    if(n == 0)return 0;
    int min = 1000001;

    for(int i = 0;i*i*i <=1000000;i++){
      for(int j = 0;j*j <= 1000000;j++){
	int x = n-i*i*i-j*j;
	if(x<0)break;
	if(min >x+i+j)min = x+i+j;
      }
    }
    cout << min << endl;

  }
  
}

C++: #include<iostream>

using namespace std;

const int INF=10000003;

int main(){
	
	int e;
	while(cin>>e){
		int ans=INF;
		for(int i=0;i*i*i<=e;i++){
			int tmp=e-i*i*i;
			for(int j=0;j*j<=tmp;j++)ans=min(ans,i+tmp-j*j+j);
		}
	cout<<ans<<endl;
	}
}

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

int main(){
  int y, z, E, res;
  
  while(cin >> E){
    if(!E) break;
    res = 1000000;
    for(z=0; z*z*z<=E; ++z){
      for(y=0; y*y+z*z*z<=E; ++y){
	res = min(res, E-(y*y+z*z*z) + y + z);
      }
    }
    cout << res << endl;
  }
  return 0;
}

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

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;}

int main(){
	const int intmax  = 1000010;
	ll int e;
	while(cin >> e,e){
		ll int ans = intmax;
		FOR(y,0,sqrt((double)e)+1){
			FOR(z,0,cbrt((double)e)+1){
				if(e-y*y-z*z*z>=0) ans = min(ans,y+z+(e-y*y-z*z*z));
			}
		}
		cout << ans << endl;
	}
	
}

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*y + z*z*z == e && x + y + z < m){
                        m = x + y + z;
                    }
                }
            }
        }
        cout << m << endl;
    }
}

C++: #include <iostream>
#include <vector>
#include<algorithm>
#include<iomanip>
#include<queue>
using namespace std;
#define rep(i,n) for(int i=1;i<=(int)(n);i++)

int main() {
	int E;
	while(cin>>E&& E>0){
		int j,k,m;
		m = 10000000;
		for(j = 0; j*j<=100000;j++){
			for(k=0;k*k*k<=100000;k++){
				int i = E - j*j - k*k*k;
				int sum = i+j+k;
				if(m>sum && i >=0){
					m = sum;
				}
			}
		}
		cout<<m<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#define MAX 10000000L;
using namespace std;

int main()
{
	long e;
	while (cin >> e && e != 0)
	{
		long min_m;
		
		bool flag = false;
		for (long m = 1; m < 1000000L; m++)
		{
			for (int z = 0; z <= m; z++)
			{
				for (int y = 0; y <= m - z; y++)
				{
					int x = m - z - y;
					if (e == x + y * y + z * z * z)
					{
						min_m = m;
						flag = true;
						break;
					}
				}

				if (flag)break;
			}

			if (flag)break;
		}

		cout << min_m << endl;
	}


	return 0;
}

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

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

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

using namespace std;

int main(){
  int e;

  while(1)
    {
      cin >> e;
      if(e == 0)break;
      int mini = INT_MAX;
      for(int z=0;z*z*z <= e;z++)
	{
	  for(int y=0;y*y<= e-(z*z*z);y++)
	    {
	      int x = e - y*y - z*z*z;
	      mini = min(mini,x+y+z);
	    }
	}
      cout << mini << endl;
    }
  return 0;
}

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

int main() {

    while(true){
    
        // 1. input end check.
        long long e;
        cin >> e;
        
        // 2. exit check.
        if(e == 0) break;
        
        // 3. calculate the minimum value.
        long long m = 1e6;
        // long long yMax = (long long) pow(e, 1.0 / 2);
        // long long zMax = (long long) pow(e, 1.0 / 3);
        long long yMax = 1000, zMax = 1000;
        for(long long z = 0; z < zMax + 1; z++){
            for(long long y = 0; y < yMax + 1; y++){
                long long x = e - y * y - z * z * z;
                if(x >= 0) m = min(m, x + y + z);
            }
        }
        
        // 4. output answer.
        cout << m << endl;
    }
    
    return 0;
    
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int e;
	while (scanf("%d", &e), e) {
		int Min = INT_MAX;
		for (int i = 0; i*i*i <= e; i++) {
			for (int j = 0; j*j <= e - i*i*i; j++) {
				Min = min(Min, i + j + e - i*i*i - j*j);
			}
		}
		printf("%d\n", Min);
	}
}