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;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  while (true) {
    int e; cin >> e;
    if (e == 0) break;
    int res = 1e9;
    for (int z = 0; z * z * z <= e; ++z) {
      for (int y = 0; y * y + z * z * z <= e; ++y) {
        int x = e - y * y - z * z * z;
        res = min(res, x + y + z);
      }
    }
    cout << res << '\n';
  }
}

C++: #include<stdio.h>
using namespaze std;

int main(){
	long long sum=1000000,E;
	int y,z;
	while(scanf("%lld",&E),E){
	for(z=0;z*z*z<=E;z++)
		for(y=0;y*y<=E;y++){
		long long x = E-z*z*z-y*y;
		if(x<0)break;
		else if(sum>x+y+z)sum=x+y+z;
		}
	printf("%lld",sum);
	}

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

#define rep(i, n) for (int i = 0; i < n; ++i)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
	int e;
	while (scanf("%d", &e), e)
	{
		int res = e;

		int z_max = pow(e, 1.0 / 3) + 1;
		int y_max = (int)sqrt(e + 0.0) + 1;
		for (int z = z_max; z; --z)
		{
			for (int y = y_max; y; --y)
			{
				int x = e - (z*z*z + y*y);
				if (x >= 0)
					min_swap(res, x + y + z);
			}
		}
		printf("%d\n", res);
	}
}

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

int main(){
 
    int e;
    int ans;
	int find;

    while(1){
        cin>>e;
        if(e==0) break;
 
        ans=10000000;
		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)<ans&&e-i*i-j*j*j>=0){
					ans=i+j+(e-i*i-j*j*j);
				}
            }
        }
        cout<<ans<<endl;
    }
 
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int x,y,z;
int e;
int minnum;
int solve(){
	z=  (int)(pow (e,1/3));
	y = (int)(sqrt(e - pow(z, 3)));
	x = (int)(e - pow(z, 3)-pow(y, 2)); 
	mininum = x+y+z;
	return mininum;
};
int main(){
	int A[100000];
    int k = 0;
	while( cin>>e && e>0 )
	{
		A[k]=solve();
        k++;
	}
	for(int l = 0;l < k; l++)
    {
        cout<<A[l]<<endl;
    }
	return 0;
}

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

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

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

int main(){

  while(cin >> E && E > 0 )

    int min = 1000001; 
    for (int z = 0; z < E; ++z)
    {
      for (int y = 0; y*y < E - z*z*z ; ++y)
      {
        int x = E - z*z*z - y*y;
        if( x + y + z < min ) min = x + y + z ;
      }
    }

cout << min << endl;

return 0;
}

C++: #include<iostream>

using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, -1, 0, 1 , 1,  1, -1, -1 };

int n;

int main() {
	while ( ~scanf( "%d", &n ) && n ) {
		int ans = n;
		for ( int i = n - 1; i >= 0; i-- ) {
			if ( i * i * i > n ) {
				continue;
			}
			for ( int j = sqrt(n - i * i * i); j >= 0; j-- ) {
				if ( i * i * i + j * j > n ) {
					continue;
				}
				ans = min( ans, i + j + ( n - ( i * i * i + j * j ) ) );
			}
		}
		printf( "%d\n", ans );
	}
	return 0;
}

C++: #include <cstdio>

inline void aizu(int e){
    int x, y, z;

    for(int xyz = 1; xyz <= e; xyz++){
        for(x = 0; x <= xyz; x++){
            for(y = 0; x + y <= xyz && x + y * y <= e; y++){
                z = xyz - x - y;
                if(x + y * y + z * z * z == e){
                    printf("%d\n", xyz);
                    return;
                }
            }
        }
    }
}

int main(void)
{
    for(int e = 1; scanf("%d", &e), e != 0;){
        aizu(e);
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
/*
int pow(int a,int b){
    int R=1;
    while(b){
        if(b&1) R=(R*a);
        a=(a*a);
        b>>=1;
    }
    return R;
}
*/
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int e;
	while(cin >> e , e){
		int m=1e+9;
		for(int z=0 , z1=0 ; z<=e; ++z1 , z=pow(z1,3.)){
			for(int y=0 , y1=0 ; y<=e; ++y1 , y=pow(y1,2.)){
				int x=e-(y+z);
				if(x>=0) m = min(m , x+(int)sqrt(y)+(int)cbrt(z));
			}
		}
		cout << m << endl;
	}
	return 0;
}