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 <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <queue>
#include <string>
#include <complex>
#include <stack>
#include <set>
#include <map>

#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i,n) for (int i = (n)-1; i >= 0; i--)
#define FOR(i,s,n) for (int i = (s); i < (n); i++)
#define ALLOF(c) c.begin(), c.end()
#define RANGEOF(c,i,n) c.begin() + (i), c.begin() + (i) + (n)
#define EPS 1e-9
#define INF 1000000000
using namespace std;

typedef complex<int> POINT;
template <class T>
class vevector : public vector<vector<T>>
{
public:
	using vector<vector<T>>::operator []; 
	T& operator [](const POINT &index) { return (*this)[index.real()][index.imag()]; }
};

template <class T> T read() { T t; cin >> t; return t; }
template <> POINT read<POINT>() { int x, y; cin >> x >> y; return POINT(x, y); }
template <class T> vector<T> read(int n) { vector<T> v; REP(i,n) { v.push_back(read<T>()); } return v; }
template <class T> vevector<T> read(int n, int m) { vevector<T> v; REP(i,n) v.push_back(read<T>(m)); return v; }
template <class T> void write(const T &t) { cout << t << endl; }
template <class T> void write(const T &t, const T &t2) { cout << t << ' ' << t2 << endl; }

template <class T> void write(const vector<T> &v)
{
	ostringstream ss; 
	for (auto x : v) ss << x << ' ';
	auto s = ss.str();
	cout << s.substr(0, s.length() - 1) << endl;
}

struct _Reader { template <class T> _Reader operator ,(T &rhs) { cin >> rhs; return *this; } };
#define READ(t,...) t __VA_ARGS__; _Reader(), __VA_ARGS__

void solve();
int main() { solve(); return 0; }

vector<unsigned char> isPrime;
vector<int> primes;
void initPrimes(int n)
{
	isPrime = vector<unsigned char>(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	FOR(i, 2, n)
	{
		if (!isPrime[i]) continue;
		primes.push_back(i);
		for (int j = i * 2; j <= n; j += i)
			isPrime[j] = false;
	}
}
/// template end ///

void solve()
{
	while (true)
	{
		READ(int, e);
		if (!(e)) { break; }

		int minimumM = INF;
		REP(z, e) REP(y, e) 
		{
			int x = e - z*z*z - y*y;
			if (x < 0) break;
			minimumM = min(minimumM, x + y + z);
		}
		write(minimumM);
	}
}

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

using namespace std;

int main() {
  int e;
  while(cin>>e && e) {
    int ans = INT_MAX;
    for(int x=0; x<e; x++) {
      for(int y=0; y<=sqrt(e); y++) {
	for(int z=0; z<=sqrt(e); z++) {
	  if(x+y*y+z*z*z==e && x+y+z<ans) {
	    ans = x+y+z;
	  }
	}
      }
    }
    cout<<ans<<endl;
  }
}

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

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

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

int main()
{
  int e;
  while (cin >> e && e != 0) {
    int ans = numeric_limits<int>::max();
    for (int z = 0; z*z*z <= e; z++) {
      const int c = e - z*z*z;
      const int y1 = int(sqrt(double(c)));
      const int m = min(c+z, c-y1*y1+y1+z);
      ans = min(ans, m);
    }
    cout << ans << endl;
  }
  return 0;
}

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

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

int main() {
	int e,x = 0,y = 0,z = 0,ans,n,i,j;
	while(1){
		ans = 10000000;
		cin >> e;
		if(e == 0)break;
		i = 1;
		while(1){
		if(i*i*i > e)break;
		i++;
		}
		i--;
		for(;i >= 0;i--){
			n = e;
			n -= i*i*i;
			z = i;
			if(n == 0){
				ans = min(ans,z);
				continue;
			}
		for(j = 0;j*j < n;j++);
		j--;
		n -= j*j;
		y = j;
		if(n == 0){
			ans = min(ans, z+y);
			continue;
		}
		x = n;
		ans = min(ans,x+y+z);
		//cout << x << " " << y  << " " << z <<endl;
		}
		j = 1;
		while(1){
		if(j*j > e)break;
		j++;
		}
		j--;
		for(;j >= 0;j--){
			n = e;
			n -= j*j;
			if(n == 0){
				ans = min(ans,j);
			}
			else{
				ans = min(ans,j+n);
			}
		//cout << n << " " << j <<endl;
		}
	cout << ans << endl;
	}
	return 0;
}

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

using namespace std;

int main() {
  int e, x, y, z, y_max, z_max, ans;
  while(true) {
    cin >> e;
    if(e == 0) break;
    ans = e;
    z_max = (int) (pow(e, 1.0/3.0)+1);
    for(z = 0; z <= z_max; z++) {
      y_max = (int) (sqrt(e-z*z*z)+1);
      for(y = 0; y <= y_max; y++) {
	x = e - y*y - z*z*z;
	if(ans > x+y+z && x >= 0) ans = x+y+z;
      }
      if(z == z_max) cout << ans << endl;
    }
  }

  return 0;
}

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

int main()
{
	while (true) {
		int e;
		cin >> e;

		if (e == 0) {
			break;
		}

		int ans = e;

		for (int x = 0; x <= e; x++) {
			for (int y = 0; y*y <= e; y++) {
				for (int z = 0; z*z*z <= e; z++) {
					if (x + y*y + z*z*z == e) {
						ans = min(x + y + z, ans);
					}
				}
			}
		}

		cout << ans << endl;
	}

	return 0;
}

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

signed main() {
	int a;
	while (cin >> a, a) {
		int s = 1 << 29;
		for (int x = 0; x < a; x++) {
			for (int y = 0;; y++) {
				for (int z = 0;; z++) {
					if (x + y*y + z*z*z == a)s = min(s,x + y + z);
					if (x + y*y + z*z*z > a)break;
				}
				if (x + y*y > a)break;
			}
		}
		cout << s << endl;
	}
}

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

int main() {
	long long e,x,y,z,min,k;
	for (;;) {
		x = y = z = k = 0, min = 1000000;
		cin >> e;
		if (e == 0) return 0;
		for(int i=0;i<sqrt(e);i++)
			for (int j = 0; j < pow(e,1.0/3.0); j++) {
				k = e - i*i - j*j*j;
				if (k>0&&min > i + j + k) {
					min = i + j + k;
					x = k, y = i, z = j;
				}
			}
		cout << x + y + z << endl;
	}
	return 0;
}

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

  int e,min;
  int y,x;
  
  while(1){
    cin >>e;
    if(e == 0)break;

    min =1e9;
    for(int i=0 ; i*i*i <= e ; i++){
      y=sqrt(e-i*i*i);
      x=e-y*y-i*i*i;
      if(x+y+i < min)min=x+y+i;
    }
    
    cout <<min<<endl;
    
  }
    
    return 0;
}