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 <vector>
#include <cmath>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define vec vector

int main(void)
{
    while(1) {
	int e;
	cin >> e;
	if (!e) break;

	int m = e;
	rep(z, (int)pow(e, 1.0/3.0) + 1) {
	    rep(y, (int)sqrt(e - z*z*z) + 1) {
		int x = e - z*z*z - y*y;
		int temp = x + y + z;
		if (m > temp) m = temp;
	    }
	}
	cout << m << endl;
    }
    return 0;
}

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

using namespace std;



int main(){

	int e;
	int x,y,z;
		int xm,ym,zm;
		int csum,msum=1000000;
	while(true){

		cin>>e;
		if(e==0) break;
		
		zm=(int) pow(e,1.0/3);
		//cout<<"zm"<<zm<<endl;
		for (int i = zm; i >=0; --i)
		{
			z=i;
			ym=(int)sqrt(e-pow(z,3));
			for (int j = ym; j >= 0; --j)
			{
				y=j;
				x=e-pow(z,3)-pow(y,2);
				csum=x+y+z;
				if(csum<msum){
					msum=csum;
				}
			}
		}
	}	
	cout<<msum<<endl;

	


return 0;
}

C++: #define REP(i,n) for (int i=0;i<(n+1);i++)
#include <iostream>
using namespace std;

int main(){
        int e;
        while(cin >> e && e > 0){
                int m = e^3;
                REP(z,e){
                        REP(y,e){
                                int x = e - y * y - z * z * z;
                                if(x >= 0){
                                        int sum = x + y + z;
                                        m = min(m,sum);
cout << x <<" " << y <<" " << z << " m= "<< m << endl;
                                }
                        }
                }
                cout << m << endl;
        }
}

C++: #include<iostream>

using namespace std;

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

C++: #include "bits/stdc++.h"
#define ALL(a) (a).begin(),(a).end()
#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)
#define debug(x) cout << #x << " : " << (x) << " --------------" << endl;
using namespace std;

int main(void){
    int e;
    while (cin >> e, e) {
        int m = 1000000;
        REP(x, 1000001) {
            if (x > e) break;
            REP(y, 1001) {
                int tmp = x + y * y;
                if (tmp > e) break; 
                REP(z, 101) {
                    int val = tmp + z * z * z;
                    if (val == e)
                        m = min(m, x + y + z);
                    else if (val > e)
                        break;
                }
            }
        }
        cout << m << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main()
{
  int x,y,z,m;
  double e;
  while(cin>>e,e){
    m=1000000;
    for(z=(int)pow(e,1.0/3.0);z>=0;z--){
      y=(int)pow(e-z*z*z,1.0/2.0);
      x=e-y*y-z*z*z;
      if(m>x+y+z)m=x+y+z;
    }
    cout<<m<<endl;
  }
}

C++: #include <iostream>
#include <math.h>

using namespace std;

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

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

int solve(int E){
    int ans = 1000000;
    for (int y = 0; y <= E; ++y){
        for (int z = 0; z <= E; ++z){
            int x = E - y*y - z*z;
            ans = min(ans, x+y+z);
        }
    }
    return ans;
}
    

int main(){
    int E;
    while (cin >> E && E>0) {
        cout << solve(E) << endl;
    }
}

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

	while(cin>>e,e){
	int m=0;
	vector<int>anss(0);
	for(int i=0;i<=e;i++){
		for(int j=0;j*j<=e;j++){
			for(int k=0;k*k*k<=e;k++){
				if(i+j*j+k*k*k<e)break;
				if(i+j*j+k*k*k==e)anss.push_back(i+j+k);
			}
		}
	}
		sort(anss.begin(),anss.end());
		cout<<anss[0]<<endl;
	}
	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <queue>

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int f(int n){
  int x, y, z;
  int ans = n;
  
  for(int y=0;y*y<=n;++y){
	for(int z=0;z*z*z<=n;++z){
	  if(y*y+z*z*z > n) break;
	  ans = min(ans, y+z+(n-y*y-z*z*z));
	}
  }

  return ans;
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  while(true){
	int N; cin >> N; if(!N) break;
	cout << f(N) << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<complex>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF (long long)1000000000
#define MOD 1000000007
#define EPS (long double) 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};

int main(void) {
	while(1) {
		int e;
		cin>>e;
		if(e == 0) break;
		ll res = INF;
		for(ll i = 0; i * i * i <= e; ++i) {
			for(ll j = 0; j * j <= e - i * i * i; ++j) {
				res = min(res, (e - i * i * i - j * j) + i + j);
			}
		}
		cout<<res<<endl;
	}
}

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

int main(void){

  int e;

while(1){
    int ans = 1000000000;
    cin >> e;
    
    if(e == 0) break;
    for(int x=0; x <= 117; x++){
      for(int y=0; y <= sqrt(e); y++){
	for(int z=0;z <= pow(e, 1.0 / 3.0); z++){
	  if(e == x + y*y + z*z*z){
	    ans = min(ans,x+y+z);
	    //cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }
    }

    cout << ans << endl;

 }
  return 0;
}