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>
using namespace std;
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define frep(i, m, n) for(int i = m;i < n;i++)
#define frepr(i, m, n) for(int i = m;i >= n;i--)
#define vsort(v) sort(v.begin(),v.end())
#define ll long long
#define inf 999999999
typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<string> vst;
typedef pair<int,int> P;
typedef pair<ll,ll> LP;
typedef pair<int,P> PP;
typedef pair<ll,LP> LPP;

int main(){
    int e;
    while(cin >> e && e!=0){
        int mini=inf;
        for(int z=0;z*z*z<=e;z++){
            for(int y=0;y*y<=e;y++){
                int x=e-z*z*z-y*y;
                if(x<0)break;
                mini=min(mini,z+y+x);
                // printf("x:%d,y:%d,z:%d min:%d\n",x,y,z,mini);
            }
        }
        cout << mini << endl;
    }

    return 0;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
int main(){
	while(true){
		int e,mn=1e9;
		scanf("%d",&e);
		if(!e) break;
		for(int z=0;z*z*z<=e;z++){
			for(int y=0;y*y+z*z*z<=e;y++){
				mn=min(mn,y+z+(e-y*y-z*z*z));
			}
		}
		printf("%d\n",mn);
	}
	return 0;
}

C++: #include<stdio.h>
using namespace std;
int main() {
	int e;
	while (scanf("%d", &e), e) {
		int m = 10000000;
		for (int y = 0; y <= 1000; y++) {
			for (int z = 0; z <= 1000; z++) {
				int x=e + y - y * y + z - z * z * z;
					if(x>=0&&e>=y*y+z*z*z)m = min(x,m);
			}
		}
		printf("%d",&m);
	}
}

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


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

			}
		}
		cout << min << endl;
	}
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
	//AOJ
	int x,sum;
	int e;
	while(1) {
		int max = 1000000;
		cin >>e ;
		if(e == 0) break;
		int e3 = (int)pow(e,1.0/3.0);
		int e2 = (int)sqrt((double)e);
		for(int i=0;i<=e3;i++){
			for(int j=0;j<=e2;j++){
				x = e-i*i*i-j*j;
				if (x >= 0){
				sum = x+i+j;
				if (sum<max) max =sum;
				}
			}
		}
		cout << max <<endl;
	}
		return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int e;

    while (cin >> e, e) {
        for (int x = 0; x <= e; x++)
            for (int y = 0; y <= e; y++)
                for (int z = 0; z <= e; z++)
                    if (x + y * y + z * z * z == e) {
                        cout << x + y + z << endl;
                        goto out;
                    }
    out:
        ;
    }

    return 0;
}

C++: #include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;

#define E 1000000

int main()
{
	int e;
	int r[10000];
	int num = 0;

	while (cin >> e && e > 0) {
		int min = E + 1;
		int e_i, e_j;

		e_i = 1000;
		e_j = 100;
		for (int i = 0; i < e_i; i++) {
			for (int j = 0; j < e_j; j++) {
				if (i*i + j*j*j > e)
					break;
				int s;
				s = (e - i*i - j*j*j) + i + j;
				
				if (s < min)
					min = s;
			}
		}

		r[num] = min;
		num++;

	}

	for (int i = 0; i < num; i++) {
		cout << r[i] << endl;
	}

    return 0;
}

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

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) (a).begin(),(a).end()
#define ifnot(a) if(not a)
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

void reader(int &a) { scanf("%d", &a); }
void reader(double &a) { scanf("%lf", &a); }
void reader(char a[]) { scanf("%s", a); }
void reader(char &a) { scanf(" %c", &a); }
void reader(ll &a) { scanf("%lld", &a); }
void reader(ull &a) { scanf("%llu", &a); }
// void reader(string& a){cin >> a;};
template<class T, class U> void reader(T& t, U& u) { reader(t); reader(u); }
template<class T, class U, class V> void reader(T& t, U& u, V& v) { reader(t); reader(u); reader(v); }

void writer(const int a, char c) { printf("%d", a); putchar(c); }
void writer(const ll a, char c) { printf("%lld", a); putchar(c); }
void writer(const ull a, char c) { printf("%llu", a); putchar(c); }
void writer(const double a, char c) { printf("%.20lf", a); putchar(c); }
void writer(const char a[]) { printf("%s", a); };
void writer(const char a[], char c) { printf("%s", a); putchar(c); };
void writer(const char a, char c) { putchar(a); putchar(c); };
template<class T> void writerLn(T t) { writer(t, '\n'); }
template<class T, class U> void writerLn(T t, U u) { writer(t, ' '); writer(u, '\n'); }
template<class T, class U, class V> void writerLn(T t, U u, V v) { writer(t, ' '); writer(u, ' '); writer(v, '\n'); }
template<class T> void writerArr(T x[], int n) { int i; if (!n) { putchar('\n'); return; }rep(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); }
template<class T> void writerVec(vector<T> x) { int n = x.size(); int i; if (!n) { putchar('\n'); return; }rep(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); }

vector<string> split(const string &str, char sep) { vector<string> v; stringstream ss(str); string buffer; while (getline(ss, buffer, sep)) { v.push_back(buffer); }return v; }
// #define int ll
bool test = 1;
int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define MAX 300000
//.....................
ull mod = (int)1e9 + 7;
#define P pair<int,int>
signed main(void)
{
	int i, j, k;
	while (1) {
		int e;
		cin >> e;
		int m = INT_MAX;
		if (e == 0) return 0;
		for (i = 100; i > -1; i--) {
			if (i*i*i > e) continue;
			for (j = 1000; j > -1; j--) {
				k = e - i*i*i - j*j;
				if (k < 0) continue;
				if (i + j + k < m) m = i + j + k;
			}
		}
	end:/*
		dump(i);
		dump(j); 
		dump(k);*/
		writerLn(m);
	}
	return 0;
}

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

int main(void){
  int e;
  while(cin>>e,e){
    //x+y^2+z^3=e<=10^6
    //x<=10^6,y<=10^3,z<=10^2
    //x+y+z=m
    
    int z = (int)pow(e,1.0/3.0)+1;
    while(z*z*z>e) --z;
    int y = (int)sqrt(e)+1;
    while(y*y>e) --y;
    int x = 100;
    while(x>e) --x;
    
    int X,Y,Z,ans=1e6;
    for(Z=z;Z>=0;--Z){
      for(Y=y;Y>=0;--Y){
        for(X=x;X>=0;--X){
          if(X+Y*Y+Z*Z*Z<e) break;
          if(X+Y*Y+Z*Z*Z==e){
            ans=min(ans,X+Y+Z);
            //cerr<<X<<","<<Y<<","<<Z<<endl;
          }
        }
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

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

int e,minimum;

int solve(){
    minimum = 1000000;
    for(int z=0;z <= pow(e,1./3.);z++){
        for(int y=0;y <= sqrt(e);y++){
            int x = e - z*z*z - y*y;
            if(x>=0)
                minimum = min(x+y+z,minimum);
        }
    }
    return minimum;
}

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