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++: #if 0
16:09-
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2012

#endif

#include <iostream>
#include <stdint.h>
using namespace std;

#define REP(var, start, count) for(int var=start; var<count; var++)

int main(void) {
	while(true) {
		int e;
		cin >> e;
		
		int ans = 10000000;
		
		if ( e == 0 ) { break; }
		
		REP(z, 0, 100) {
			int z3 = z*z*z;
			if ( z3 > e ) { break; }
			
			REP(y, 0, 1000) {
				if ( y*y > e-z3 ) { break; }
				
				int x = (e-z3-y*y);
				int res = x+y+z;
				if ( res < ans ) { ans = res; }
			}
		}
		
		cout << ans << endl;
	}

}

C++: #include<iostream>
#include<cmath>
using namespace std;
int solve(int E)
{
    int ans=0;
    for(int x=0;x<=E;++x)
        for(int y=0;y<=(int)round(pow(E-x,1.0/2));++y)
            for(int z=0;z<=(int)round(pow(E-x-y*y,1.0/3));++z)
            {
                if(x+y+z>ans)
                    ans=x+y+z;
            }
    return ans;
}
int main()
{
    int E;
    while(cin>>E&&E>0)
        cout<<solve(E)<<endl;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int solve(int E){
    int ans=E;
    for (int x=0;x<=E;++x){
        for (int y=0;y*y+x<=E;++y){
            int z=(int)round(pow(E-x-y*y,1.0/3));
            if(x+y*y+z*z*z==E&&ans>x+y+z){
             ans=x+y+z;
            }
        }
    }
    return ans;
}
int main(){
    int E;
    while (cin>>E&&E>0){
        cout<<solve(E)<<endl;
    }
}

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

int solveZY(int e,int min) {
	int tempmin,X;
	for(int Z = 0; Z*Z*Z<=e; Z++) {
		for(int Y = 0; Y*Y<=(e-Z*Z*Z); Y++) {
			X = e-Y*Y-Z*Z*Z;
			tempmin = X+Y+Z;
			//cout << X << " " << Y << " " << Z << endl;
			//cout << tempmin << endl;
			if((tempmin<min) && (X+Y*Y+Z*Z*Z == e)) {
				min = tempmin;
			}
		}
	}
	return min;
}

int main() {

	int E;
	int min;

	while(true) {
		cin >> E;
		if(E == 0) {
			break;
		}
		min = 1000000;
		min = solveZY(E,min);

		cout << min << endl;

	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
using namespace std;
main(){
  int e;
  while(cin>>e,e){
    int ans=1e9;
    for(int z=0;;z++){
      if(z*z*z>e)break;
      for(int y=0;;y++){
        if(z*z*z+y*y>e)break;
        int a=e-z*z*z+y*y;
        ans=min(ans,a+y+z);
      }
    }
    cout<<ans<<endl;
  }
}

C++: #include <iostream>

using namespace std;

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

C++: #include <stdio.h>
#include <iostream>
#include <queue>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#define PB push_back
#define in scanf
#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--)
using	namespace std;
void solve(){
	int e;
	while(cin >> e ,e!=0) {
	int m =1000000000;
	int x;
	REP(z,100){
		REP(y,1000){
			x = e-pow(y,2)-pow(z,3);
			if(x>=0)m = min(x + y + z,m);
				
		}
	}
	cout << m  << endl;
	
}
}



	
int main(){
	solve();

}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double e;
  while(cin >> e && e){
    double m = inf;
    for(int i = 0; i * i * i <= e && i <= 100; ++ i){
      for(int j = 0; j * j <= e - pow(i,3) && j <= 1000; ++ j){
        if(e - pow(i,3) - pow(j,2) >= 0 && e - pow(i,3) - pow(j,2) <= 1000000){
          m = min(m,i+j+e-pow(i,3)-pow(j,2));
        }
      }
    }
    cout << m << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>
#include <math.h>


using namespace std;

int main(int argc, char const* argv[])
{
    int e;
    while (cin >> e, e) 
    {
        int x,y,z;
        int m = 1000000;

        //for (int i = 0; i <= e; i++) 
        //{
        //    for (int j = 0; j*j <= e; j++) 
        //    {
        //        for (int k = 0; k*k*k <= e; k++) 
        //        {
        //            //cout << " x y z = " << i << j << k <<endl;
        //            if ( i + j*j + k*k*k == e) 
        //            {
        //                m = min( m, i + j + k);
        //            }
        //        }
        //    }
        //}
        for (int k = 0;  k*k*k <= e; k++) 
        {
            int j = sqrt(e - k*k*k);
            int i = e - k*k*k -j*j;
            m = min( m, i + j + k);
        }
        cout << m << endl;
    }
    return 0;
}

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

int main(){
  int E;
  while(cin >> E){
    int sum;
    for(int z=100;z>=0;z--){
      if(E-z*z*z>=0){
        int t=E-z*z*z;
        int y=(int)sqrt(t);
        int x=t-y*y;
        sum=x+y+z;
        break;
      }
    }
    cout << sum <<endl;
  }
}

C++: #include <iostream>

using namespace std;

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

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

int solve (int e) {
  int num;
  long long int min = e;
  for (long long int l=e + 1; l >= 0; l--) {
    for (long long int k = e - l*l*l + 1; k >= 0; k--) {
      for (long long int i = e - l*l*l - k*k + 1; i >= 0 ; i--) {
        if (i + k*k + l*l*l == e && min > i + k + l) {
          min = i + k + l;
          num = k;
          break;
        }
      }
    }
  }
  int k = num;
  for (long long int l2=e + 1; l2 >= 0; l2--) {
    for (long long int i = e - l2*l2 - k*k*k + 1; i >= 0 ; i--) {
      if (i + k*k*k + l2*l2 == e && min > i + k + l2) {
        min = i + k + l2;
        break;
      }
    }
  }
  return min;
}

int main () {
  long long int e;
  cin >> e;
  if(e == 0){
    return 0;
  }
  cout << solve(e) << endl;
}