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 <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 28)

template<typename T>
void remove(vector<T>& vector, unsigned int index){
vector.erase(vector.begin() + index);
}

typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){
	int e;
	while(cin >> e, e){
		int mini = e;
		for(int z = 0; e >= pow(z,3); z++){
			for(int y = 0; e-pow(z,3) >= pow(y,2); y++){
				int x = e - pow(z,3) - pow(y,2);
				if(x < 0)continue;
				mini = min(mini, x+y+z);
			}
		}
		cout << mini << endl;
	}

	return 0;
}



int StrToInt(string s){
	stringstream ss;
	ss << s;
	int val;
	ss >> val;
	return val;
}
string IntToStr(int i){
	stringstream ss;
	ss << i;
	return ss.str();
}

C++: #include <bits/stdc++.h>
using namespace std;
const int dx[]={1,0,0,-1,1,-1,-1,1,2,0,-2,0};
const int dy[]={0,1,-1,0,1,1,-1,-1,0,2,0,-2};
const int INF = 1<<30;
const double EPS = 1e-8;
#define PB push_back
#define mk make_pair
#define fr first
#define sc second
#define reps(i,j,k) for(int i = (j); i < (k); ++i)
#define rep(i,j) reps(i,0,j)
#define MOD 1000000007
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
typedef pair<int,int> Pii;
typedef pair<int,Pii > P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
int main(){
	int e;
	while(scanf("%d",&e),e){
		int ans = INF;
		rep(y,1001){
			rep(z,101){
				int Y = y*y;
				int Z = z*z*z;
				if(Y+Z > e)continue;
				ans = min(ans,e-Y-Z+y+z);
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n;
	//x+y*y+z*z*zの、xが最少となるyとzの組み合わせを探す。
	while(cin>>n,n){
		int ans=0,now=n,now2=n,ans2=0,tmp=10e8;
			for(int i=0;i<10000;i++){
				for(int j=0;j<103;j++){
					if(n-i*i-j*j*j>=0&&n-i*i-j*j*j<tmp){
						tmp=n-i*i-j*j*j;
						ans=i+j+(n-i*i-j*j*j);
					}
				}
			}
			cout<<ans<<endl;
		}
		return 0;
	}

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

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

C++: #include "bits/stdc++.h"
using namespace std;
#define int long long
#define endl '\n'
int mod=1e9+7;
int mod2=998244353;

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

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

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

C++: #include <stdio.h>
int main()
{
  int a,x,y,z,min;
  while(1){
    scanf("%d",&a);
    x=0;
    y=0;
    z=0;
    min=1000000;
    if(a==0)break;
    for(z=0;z*z*z<=a;z++){
      for(y=0;a-z*z*z>=y*y;y++){
      }
      y--;
      x=a-(z*z*z)-(y*y);
      //printf("%d %d %d\n",x,y,z);/// 
      if(min>x+y+z)min=x+y+z;
    }
    printf("%d\n",min);
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 300000;
    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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
  int y, z, E, res;
  
  while(cin >> E){
    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 <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

int main(){
	int e,m,a;
	
	while(1){
		cin >> e;
		m=e;
		if(e==0){
			return 0;
		}
		for(int i=0;i<m;i++){
			for(int j=0;j<m-i;j++){
				a=e-i*(i-1)-j*(j-1)*(j+1);
				if((a>=i+j)&&(m>a)&&(a>=0)){
					m=e-i*(i-1)-j*(j-1)*(j+1);
				}
			}
		}
		cout << m <<"\n";
	}
			
return 0;
}

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

using namespace std;

int main(){
	int sq[1001],cb[101];
	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 <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int main(){
    while(1){
        int n;
        cin >> n;
        if(n==0) break;

        int smin=n;
        for(int z=0; z*z*z<=n; z++){
            int diff = n-z*z*z;
            int y = sqrt(diff);
            int x = diff - y*y;
            smin = min(x+y+z ,smin);
        }
        cout << smin << endl;
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

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

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

int main(){
    int e;
    
    while(cin >> e,e){
        //x+y^2+z^3=e
        int ans = INF;
        
        for(int z = 0 ; z*z*z <= e ; z++){
            for(int y = 0 ; (y*y)+(z*z*z) <= e ; y++){
                ans = min(ans,e-y*y-z*z*z+y+z);
            }
        }
        
        cout << ans << endl;
    }
    
    return 0;
}

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

using std::cin;
using std::cout;
using std::endl;

int main(void) {
	int e;
	cin >> e;

	while (e != 0) {
		bool find = false;
		int m,n,sum;
		for (int x = 0; x < e+1; x++) {
			for (int y = 0; pow(y,2) < e+1; y++) {
				for (int z = 0; pow(z,3) < e+1; z++) {
					n = x + y + z;
					sum = x + pow(y,2) + pow(z,3);
					if (sum == e) {
						if (!find) {
							m = n;
							find = true;
						}
						else if (n < m) {
							m = n;
						}
					}
				}
			}
		}
		cout << m << endl;

		cin >> e;
	}
	return 0;
}