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>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(x) for(auto it=(x).begin();it!=(x).end();it++) 
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
 
using namespace std;
 
int main(){
    while(1){
        int e;
        int ans=1e9+7;
        cin>>e;
        if(e==0)break;
         
        rep(y,0,1000){
            rep(z,0,1000){
                int k=e-y*y-z*z*z;
                if(k<0)continue;
                ans=min(ans,x+y+z);
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include<iostream>

#define min(a,b) a<b?a:b
int e;
const int MAX_E = 1000000;
using namespace std;

void solve() {

    int ans=100000000;
    for(int z=0;z*z*z<=MAX_E;z++) {
        for(int y=0;y*y<=MAX_E;y++) {
            int x = e - y*y;
            if(x<0) break;
            x -= z*z*z;
            if(x<0) break;
            ans=min(ans,x+y+z);
        }
    }
    cout<<ans<<endl;

}

int main() {

    while(cin>>e) {
        if(e==0) return 0;
        solve();

    }
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#define MAX (2000000)
#define INF (1145141919)
using namespace std;

int dp[MAX + 1];

int main()
{
	for (int i = 1000000; i >= 0; i--){
		dp[i] = i;
	}
	
	for (int i = 1000000; i >= 0; i--){
		for (int y = 0; y <= 1000; y++){
			dp[i + y * y] = min(dp[i + y * y], dp[i] + y);
		}
	}
	
	for (int i = 1000000; i >= 0; i--){
		for (int z = 0; z <= 100; z++){
			dp[i + z * z * z] = min(dp[i + z * z * z], dp[i] + z);
		}
	}
	
	int e;
	while (scanf("%d", &e), e){
		printf("%d\n", dp[e]);
	}
	
	return 0;
}

C++: #include<stdio.h>

int main(){
	long long E, sum=1000000;
	int y,z;
	long long x= E-z*z*z-y*y;
	while(scanf("%lld",&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;
			}
		printf("%lld",sum);
	}
        return 0;
}

C++: // Space Coconut Crab
#include <iostream>
using namespace std;
int count = 0; // ?¨???¬??¨ global ?????°
int solve(int E) {
  // ?????´????±???????
  // x+y*y+z*z*z=E
  int ans = E; // ?????§??? 
  for (int z=0; z*z*z<=E; ++x)
    for (int y=0; y*y<=E-z*z*z; ++y)
      for (int x=0; x<=E-y*y-z*z*z; ++z) {
        ++count;
        if (x+y*y+z*z*z == E)
          if (x+y+z < ans) // x+y+z??????????°??????????ans?????´??°
            ans = x+y+z;
      }
  return ans;
}
int main() {
  int E;
  while (cin >> E && E>0) {
    cout << solve(E) << endl; 
  }
}
// ?????´?????????????????¨?????????????????????????????? 10^11???...8?§???\?????????
//

C++: // Space Coconut Crab
#include <iostream>
using namespace std;
int count = 0; // ?¨???¬??¨ global ?????°
int solve(int E) {
  // ?????´????±???????
  // x+y*y+z*z*z=E
  int ans = E; // ?????§??? 
  for (int z=0; z*z*z<=E; ++z)
    for (int y=0; y*y<=E-z*z*z; ++y)
      for (int x=0; x<=E-y*y-z*z*z; ++x) {
        ++count;
        if (x+y*y+z*z*z == E)
          if (x+y+z < ans) // x+y+z??????????°??????????ans?????´??°
            ans = x+y+z;
      }
  return ans;
}
int main() {
  int E;
  while (cin >> E && E>0) {
    cout << solve(E) << endl; 
  }
}
// ?????´?????????????????¨?????????????????????????????? 10^11???...8?§???\?????????
//

C++: #include<iostream>

using namespace std;

int max(int ,int );

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

C++: #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
int main(void){
	while(1){
		ll num,ans=1000000;
		cin >> num;
		if(!num)	break;
		for(ll y=0;pow(y,2)<=num;y++){
			for(ll z=0;pow(z,3)<=num;z++){
				ll x=num-y*y-z*z*z;
				if(x<0)	break;
				ans = min(ans,(x+y+z));
				//if((x+y+z)==43)	cout << x << ' ' <<	y << ' ' << z << endl;
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  while(1){
    int e,a;cin>>e;if(e==0)break;a=e;
    for(int i=0,z=0;z<=e;i++,z=i*i*i)
      for(int j=0,y=0;y+z<=e;j++,y=j*j)
	if(i+j+e-y-z<a)a=i+j+e-y-z;
    cout<<a<<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;}

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

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

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

	int x,y,z;

	int cb = cbrt(e);
	
	int m = 1000000;

	REP(i,cb){
	  z = cb - i;
	  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>
using namespace std;

int main(){
  while(1){
  int e,min=100000000,ans;
 cin>>e;
 if(e==0) break;
 for(int i=0;i*i*i<e;i++){
   for(int j=0;j*j<=e;j++){
     ans=e-(i*i*i+j*j);
     if(min>ans+j+i && e>=ans && ans>=0) min=ans+i+j;
   }
 }
 cout<<min<<endl;
  }
 return 0;
}

C++: 
#include <iostream>

int main(int argc, char const *argv[]) {
  int count = 10^6;
  for (int  i = 0; i < count; i++) {
    int e= 0;
    cin >> e ;
    if (e==0){
      return 0;
    }
    int min = e;
    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;
        int m = x+y+z;
        if (m < min){
          min = m;
        }
      }
    } //
    cout << min << endl;
  } //
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <initializer_list>

using namespace std;

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

    return 0;
}

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

#define INF 1e9

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

    int y, sum, nmin = INF;
    for(int i=0; i<=cbrt(e); i++){
      sum = e - i*i*i;
      y = sqrt(sum);
      sum -= y*y;
      nmin = min(nmin, sum + y + i);
    }
    cout << nmin << endl;
  }
  
  return 0;
}