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;
int main(void){
int e;
long long minm;
vector<vector<vector<int> > >nums(345,vector<vector<int> >(174,vector<int>(101)));
for(int i=0;i<345;i++){
	for(int j=0;j<174;j++){
		for(int k=0;k<101;k++){
			nums[i][j][k]=(i+j*j+k*k*k);
		}
	}
}
while(true){
cin>>e;
if(e==0)break;
minm=LLONG_MAX;
for(int i=0;i<345;i++){
	for(int j=0;j<174;j++){
		for(int k=0;k<101;k++){
			if(e==nums[i][j][k])minm=min(minm,(long long)i+j+k);
		}
	}
}
cout<<minm<<endl;
}
return 0;
}

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 = 100000000;
		for(j = 0; j*j<=E;j++){
			for(k=0;k*k*k<=E;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>
using namespace std;

int main() {
  int e;
  while (scanf("%d", &e) != EOF && e) {
    int m = 1000;
    for (int z=100; z>=0; z--) {
      if (e < z*z*z) {
	continue;
      }
      for (int y=0; y<m; y++) {
	if (e < y*y + z*z*z) {
	  break;
	}
	int x = e - y*y - z*z*z;
	if (x + y + z < m) {
	  m = x + y + z;
	}
      }      
    }      
    printf("%d\n", m);
  }
}

C++: #include<iostream>
using namespace std;
int main() {
	int e;
	while (scanf("%d", &e), e) {
		int m = 10000000;
		for (int y = 0; y <= 10000; y++) {
			for (int z = 0; z <= 1000; z++) {
				int x=e + y - y * y + z - z * z * z;
					if(x>=0&&e>=y*y+z*z*z)m = min(x,m);
			}
		}
		printf("%d",&m);
	}
}

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;
}
elseif(e%j*j*j!=0&&e%i*i==0){
m=i;
}
elseif(e%j*j*j!=0&&e%i*i!=0){
m=e;
}
}
}
cout << m << endl;
}
return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 500;
    for (int z=0; z<=100; z++){
      if(z >= m) break;
      for(int y=0; y<= sqrt(E-pow(z,3));y++){
	 if (y+z >= m) break;
	    int x = E - pow(z,3) - pow(y,2);
	    if (x >= 0){
	      if(x+y+z < m){
		m = x+y+z;
	      }
	    }
      }
    }
    cout << m << endl;
  }
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
 
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef complex<double> P;
static const double EPS = 1e-8;
static const int INF = (int)1e8;
 
#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) for (int i=0; i<(int)(n); ++i)
#define FOREQ(i,k,n) for (int i=(k); i<=(int)(n); ++i)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define FIND(m,w) ((m).find(w)!=(m).end())
 
int main(void){
  int e;
  while(cin>>e,e){
    int ans = e;
    for(int z = 0; z*z*z<=e; z++){
      for(int y = 0; y*y+z*z*z<=e; y++){
        int x = e - y*y - z*z*z;
        ans = min(ans,x+y+z);
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

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

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++){
				if (min > i + j + e - (i * i * i + j * j)){
					min = i + j + e - (i * i * i + j * j);
				}
			}
		}

		printf("%d\n", min);
	}

	return (0);
}

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

int main() {
	for(int E; cin >> E && E; ) {
		int best = 1 << 30;
		
		for(int z = 0; z * z * z <= E; z++) {
			for(int y = 0; y * y + z * z * z <= E; y++) {
				int x = E - y * y - z * z * z;
				
				best = min(best, x + y + z);
			}
		}
		
		cout << best << endl;
	}
}

C++: #include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#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--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
 
using namespace std;
 
 
int main(){
  int e;
  while(cin>>e,e){
    vector<int> dp(e+1,e);
		vector<int> z;
        for(int i = 0;i*i*i<=e;i++){
					z.push_back(i*i*i);
				}
				int z_size = z.size();
				for(int i = 0;i<z_size;i++){
					for(int j = 0;z[i]+j*j<=e;j++){
							int yy = j*j;
							dp[z[i]+yy] = min(i+j,dp[z[i]+yy]);
							dp[e] = min(e-z[i]-yy+dp[z[i]+yy],dp[e]);
					}
				}
				cout << dp[e] << 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;}

long long int dou(long long int a){
  return a*a;
}

long long int tri(long long int a){
  return a*a*a;
}
 
int main(){

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

	long long int x,y,z;

	long long int cb = cbrt(e);

	long long int m = 10000;

	REP(i,cb){
	  z = cb - i;
	  long long int huga = sqrt(e - tri(z));
	  REP(j,huga){
		y = huga - j;
		x = e - tri(z) - dou(y);
		if(m>(x+y+z)) m = x+y+z;
	  }
	}

	cout << m << endl;

	//	cout << z << endl;


  }
}

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

int main()
{

  int e;
  while(cin >> e, e){
    int minx = 1111111111;

    for(int i = 0; i*i <= e; i++){
      for(int j = 0; j*j*j <= e; j++){

        int z = e-(i*i+j*j*j);
        int tmp = i*i + j*j*j + z;

        if(z >= 0 && tmp == e){
          minx = min(minx, i+j+z);

        }

      }
    }

    cout << minx << endl;

  }

  return 0;

}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int e;
    while(scanf("%d",&e),e){
        int m=1<<25;
        for(int i=0;i<=e;i++){
            for(int j=0;i+j*j<=e;j++){
                for(int k=0;i+j*j+k*k*k<=e;k++){
                    if(i+j*j+k*k*k==e){
                        m=min(m,i+j+k);
                    }
                }
            }
        }
        printf("%d\n",m);
    }
    return 0;
}