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 <algorithm>
using namespace std;

int e;

int main() {
	while (cin >> e) {
		if (!e) break;
		
		int ans = 1145141919;
		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;
				if (x < 0) continue;
				ans = min(ans, x + y + z);
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main() {
    int e;
    while (cin >> e, e) {
        int ret = 1e6;
        for (int z=0; z*z*z<=e; ++z) {
            int y = (int)sqrt(e - z*z*z);
            int x = e - z*z*z - y*y;
            ret = min(ret, x+y+z);
        }
        cout << ret << 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;}

ll int pow(int a,int b){
  int ans = 1;
  REP(i,b) ans = ans * a;
  return ans;
}


int hoge(int e){

  int num;

  REP(a,e+1){
	REP(b,e+1){
	  REP(c,e+1){
		num = a + b*b + c*c*c;
		//		cout << num << endl;
		if(num > e) break;
		if(num == e) return (a + b + c);
		
	  }
	}
  }
  
	return -1;

}

int main(){

  int e;

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

	cout << hoge(e) <<endl;

  }
}

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

int e = 0;

int solve(){
    int x,y,z;

    int res = INT_MAX;
    for(z=0; z<=e; ++z){
        for(y=0;y<=e;++y){
            x = e - y*y - z*z*z;
            if(x >= 0){
                res = std::min(res, x+y+z);
            }
        }
    }
    return res;
}

int main(void){
    while(true){
        std::cin >> e;
        if(e == 0) break;
        std::cout << solve() << std::endl;
    }
}

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 <= 100; ++ i){
      for(int j = 0; j <= 1000; ++ j){
        int x = e - pow(i,3) - pow(j,2) ;
        if(x >= 0 && x <= 1000000){
          m = min(m,i+j+e-pow(i,3)-pow(j,2));
        }
      }
    }
    cout << m << endl;
  }
  return 0;
}

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

C++: #pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using ull=unsigned long long int;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
while(1){
  ll n;
  cin>>n;
  if(n==0)return 0;
  ll ans=inf;
  for(ll i=0;i*i*i<=n;i++){
    for(ll j=0;i*i*i+j*j<=n;j++){
      chmin(ans,n-i*i*i-j*j+i+j);
    }
  }
  cout<<ans<<"\n";
}
}

C++: #include <iostream>

using namespace std;

int main(){
	int e,x,y,z,small ;
	x=0;
	y=0;
	z=0;
	small=10000000;
	while(cin >> e && e>0)
		break(e == 0;)
		while(z*z*z <= 1000000){
			while(y*y <= 1000000){
				x = e-y*y-z*z*z;
				if (small > x+y+z){
				small = x+y+z;
				}
			y = y+1;
			}
		z = z+1;
		}
	cout << small << endl ;
	}
}

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

using namespace std;

typedef long long ll;
typedef pair<int, int> duo;

#define TT template<typename T>
TT T    sq(T x){ return x*x; }
TT int  ubnd(vector<T>& v,T x){ return upper_bound(v.begin(), v.end(), x) - v.begin(); }
TT int  lbnd(vector<T>& v,T x){ return lower_bound(v.begin(), v.end(), x) - v.begin(); }
TT void sort(T& v){ sort(v.begin(), v.end()); }
TT void revs(T& v){ reverse(v.begin(), v.end()); }
TT void uniq(T& v){ sort(v); v.erase(unique(v.begin(), v.end()), v.end()); }
TT void show(T& v,char d=' ',char e='\n'){for(int i=0;i<v.size();++i)cout<<v[i]<<((i==v.size()-1)?e:d);}
TT void inpt(vector<T>& v,int n){ v.reserve(n);for(int i=0;i<n;++i){T x; cin>>x; v.push_back(x);} }
TT T In(){ T x; cin >> x; return x; }

static inline void fast_io(){ ios::sync_with_stdio(0); cin.tie(0); }
static inline int in(){ int x; scanf("%d", &x); return x; }
static inline string instr(){ string x; cin >> x; return x; }
static const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
static const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};

int main()
{
  while (int e = in()){
    int m = 1e8;
    for (int z = 0; z <= 100; ++z){
      for (int y = 0; y <= 1000; ++y){
        int x = e - (sq(z) * z + sq(y));
        if (x < 0) continue;
        m = min(m, z + y + x);
      }
    }
    printf("%d\n", m);
  }
  return (0);
}