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 <cmath>
using namespace std;
int calcOver(int, int);
int calcM(int, int ,int);

int main() {
  while(true) {
    int e;
    cin >> e;
    if(e == 0) break;
    int y = 0;
    int z = 0;
    int maxover = 0;
    int limity = pow(e, 1.0 / 2.0);
    int limitz = pow(e, 1.0 / 3.0);
    int maxy = limity;
    int maxz = limitz;
    int minm = e;
    //cout << limity << ":" << limitz << endl;
    for(y = limity; y >= 0; --y) {
      for(int z = limitz; z >= 0; --z) {
        int over = calcOver(y, z);
        int m = calcM(e, y, z);
        //cout << y << ":" << z << ":" << over << endl;
        if(e >= over) {
          //cout << "ok" <<endl;
          //if(maxover <= over && ((maxy + maxz) >= (y + z))) {
          if(minm > m) {
          //cout << "ok" <<endl;
            maxy = y;
            maxz = z;
            //maxover = over;
            minm = m;
          }
          
        }
      }
    }
    //cout << maxy << ":" << maxz << endl;
    cout << (e - pow(maxy, 2) - pow(maxz, 3) + maxy + maxz) << endl;
  }
  return 0;
}

int calcOver(int y, int z) {
  return (pow(y, 2) + pow(z, 3));
}
int calcM(int e, int y, int z) {
  return (e - pow(y, 2) - pow(z, 3) + y + z);
}

C++: #include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using P = pair<ll, ll>;
const long double PI = acos(-1.0L);
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; }

int e;

int main() {
    while(1) {
        cin >> e;
        if(e == 0) break;
        int ans = 1e9;
        for(int y = 0; y*y <= e; ++y) {
            for(int z = 0; z*z*z <= e; ++z) {
                int x = e-y*y-z*z*z;
                if(x >= 0) {
                    chmin(ans, x+y+z);
                }
            }
        }
        cout << ans << endl;
    }
}

C++: #include<bits/stdc++.h>
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;y*y+z*z*z<=e;y++){
	m = min(m, z + y + e-y*y-z*z*z);
      }
    }
    cout << m << endl;
  }
}

C++: #include<iostream>
#include<climits>
using namespace std;
	int main(){
		int x,y,z,e,m,p,q,r,min;
		while(cin>>e,e){
			x=0;
			y=0;
			z=0;
			min=INT_MAX;
			for(p=0;p*p*p<=e;p++)
			if(p>z)
				z=p;
			for(int i=z;i>=0;i--){
				for(q=0;q*q<=e-i;q++)
					if(q>y)
						y=q;
				for(int j=y;j>=0;j--){
					for(r=0;r<=e-i-j;r++)
						if(r>x)
							x=r;
					for(int k=0;k<=x;k++){
						
						if(i*i*i+j*j+k==e){
							if(min>i+j+k)
							min=i+j+k;
							break;
						}
						
						
					}
				}
			}
			cout<<min<<endl;
		}
		return 0;
	}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int> PI;
#define MAX 1000009
int main(){
    int e;
    while(cin>>e,e){
        vector<PI> v3;
        for(int i =0;i<=100;i++){
            PI temp;
            temp.first=pow(i,3);temp.second=i;
            v3.push_back(temp);
        }
        vector<PI> v2;
        for(int i=0; i<=10000;i++){
            PI temp;
            temp.first=pow(i,2); temp.second=i;
            v2.push_back(temp);
        }
        PI min; min.first=INF; min.second=INF;
        for(int i=(int)v3.size()-1; i>=0;i--){
            for(int j=(int)v2.size()-1; j>=0;j--){
                if(v3[i].first+v2[j].first<=e){
                    if(min.second+min.first>e-(v3[i].first+v2[j].first)+v3[i].second+v2[j].second){
                        min.second=v3[i].second+v2[j].second;
                        min.first=e-(v3[i].first+v2[j].first);
                    }
                }
            }
        }
        cout<<min.second+min.first<<endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int e;
while(true){
cin >> e;
if(!e)
break;
int x,y,z;
int ans = e;
for(z=0;z*z*z<=e;z++){for(y=0;y*y+z*z*z<=e;y++){int b=e-(y*y+z*z*z);ans = min(ans,b+y+z);
}
}
cout << ans <<endl;
}
}

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

int crab(int E)
{
    int ans {E};
    for (int z {}; z * z * z <= E; ++z)
        for (int y {}; y * y + z * z * z <= E; ++y)
            if (E - y * y - z * z * z >= 0)
                ans = std::min(ans, E - y * y - z * z * z + y + z);
    
    return ans;
}

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

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



int main() {
	while (true) {
		int ans = 100000000;
		int n;
		cin >> n;
		if (n == 0) return 0;
		for (int i = 0; i < n; i++) {
			int num = i * i * i;
			if (num > n) break;
			int num2 = sqrt(n - num);
			int num3 = n - num - (num2 * num2);
			ans = min(ans, i + num2 + num3);
		}
		cout << ans << endl;
	}
	return 0;
}

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

#define MAX 1000000

using namespace std;

vector <int> y;
vector <int> z;

int main(void){
	for(int i=0; ; i++){
		y.push_back(i*i);
		if(y[i] > MAX) break;
	}
	for(int i=0; ; i++){
		z.push_back(i*i*i);
		if(z[i] > MAX) break;
	}

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

		int ans = MAX;
		for(int i=0; i<y.size(); i++){
			for(int j=0; j<z.size(); j++){
				if(y[i]+z[j] <= e){
					int x = e-(y[i]+z[j]);
					ans = min(ans, x + i + j);
				} else break;
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
int main(){


int E;
while(1){
scanf("%d",&E);if(E==0)break;
int min=E;int m=E,max=0;
int i=1;int y=0,z=0;
for(int j=0;j*j<=(E);j++){
	
for(int k=0;k*k*k<=(E-j*j);k++)
{i=E-j*j-k*k*k;//printf("%d %d %d\n",i,j,k*k*k);
	if(i+j*j+k*k*k>E)break;
	if(i>=0&&i+j*j+k*k*k==E&&i+j+k<min){min=i+j+k;max=j*j+k*k*k;y=j;z=k;}
}}
i=E-y*y-z*z*z;
m=i+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 = 100;
    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>
using namespace std;

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

}