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 lp(i,n) for(int i=0;i<n;i++)
int main(){
	while(1){
		int e;
		cin>>e;
		if(e==0) break;
		int ans=e,z;
		for(int i=0;i*i*i<=e;i++){
			for(int j=0;j*j+i*i*i<=e;j++){
				z=e-i*i*i-j*j;
				ans=min(ans,z+i+j);
			}
		}
		cout<<ans<<endl;
	}

	return 0;
}

C++: #include <cmath>

using namespace std;

int pw (int n, int p) {
  if (n == 0) return 0;
  if (p == 0) return 1;
  if (p == 1) return n;
  return n * pw(n, p-1);
}

int computeM (int e) {
  
  int ret = e;
  
  // zが最も自由度の小さい数なので、zから決定していく。

  for(int y = 0; y <= sqrt(e); y++) {
    for(int z = 0; z <= sqrt(e); z++) {
      int temp = pw(y, 2) + pw(z, 3);
      int x = e - temp;
      if (x < 0) x = 0;
      if (x + temp == e) ret = min(x + y + z, ret);
    }
  }
  

  return ret;
}

int main (void) {
  int e, m;

  while (1) {
    cin >> e; if (e == 0) break;
    m = computeM(e);
    cout << m << endl;
  }
  return 0;
}

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

int main() {
	int e;
	while(cin >> e && e > 0) {
		int x, y, z;
		int maxz, maxy;
		int min = 1000000;
		maxz = int(pow(e, 1.0/3.0));
		maxy = int(pow(e, 1.0/2.0));
		//cout << "maxz:" << maxz << endl;
		//cout << "maxy:" << maxy << endl;
		for(int z = 0; z <= maxz; z++) {
			for(int y = 0; y <= maxy; y++) {
				x = e - y*y - z*z*z;
				if(x >= 0 && x+y+z < min) min = x+y+z;
			}
		}
		cout << min << endl;
	}
}

C++: #include <iostream>
#define llint long long

using namespace std;

llint e;

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

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

using namespace std;

long solve(long m){
    long min = 1000000;
    for(long x = 0; (x * x * x) <= m; ++x){
        long n = m - (x * x * x);
        for(long y = 0; (y * y) <= n; ++y){
            long z = n - (y * y);
            if( x + y + z < min){
                min = x + y + z;
            }
        }
    }
    return min;
}

int main(){
    while(1){
        int input;
        cin >> input;
        if(input == 0){
            return 0;
        }
        cout << solve(input) << endl;
    }
}

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){
	for(int y=0; y<= sqrt(E-pow(z,3));y++){
	  if (y+z <m){
	    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++: #define REP(i,n) for (int i=0;i<(n+1);i++)
#include <iostream>
using namespace std;

int main(){
        int e;
        while(cin >> e && e > 0){
                int m = e^3;
                REP(z,e){
                        REP(y,e){
                                int x = e - y * y - z * z * z;
                                if(x >= 0){
                                        int sum = x + y + z;
                                        m = min(m,sum);
                                }
                        }
                }
                cout << m << endl;
        }
}

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

typedef std::int_fast32_t  s32;
typedef std::uint_fast32_t u32;
typedef std::int_fast64_t  s64;
typedef std::uint_fast64_t u64;

const unsigned long mod = 1000000007;
const double EPS = 0.00000001;
const int INF = (1 << 29);

typedef std::pair<int, int> pii;

template<typename T>
void print_array(T *A_, s32 size) {
  //printf("%d\n", size);
  if( size != 0 ) {
    for(int i = 0; i < size - 1; ++i) {
      printf("%d ", A_[i]);
    }
    printf("%d\n", A_[size - 1]);
  }
}


auto main() -> int {

  for(;;) {
    int e;
    std::cin >> e;
    if( e == 0 ) break;

    int res = INF;
    for(int z = 0; z <= 100; ++z) {
      for(int y = 0; y <= 1000; ++y) {
        int x = e - z * z * z - y * y;
        if( x < 0 ) continue;
        if( x + y + z < res ) {
          res = x + y + z;
        }
      }
    }
    
    std::cout << res << std::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<=sqrt((double)(E));j++){
for(int k=0;k<=pow((double)(E-j*j),1.0/3.0);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 <bits/stdc++.h>
using namespace std;

int main() {
    int e;
    while (true) {
        scanf("%d", &e); if (e == 0) break;
        int m = e;
        int vmin = -1;
        for (int z = 0; z*z*z <= e; ++z) {
            for (int y = 0; y*y+z*z*z <= e; ++y) {
                int x = e-z*z*z-y*y;
                if (m > x+y+z) m = x+y+z;
            }
        }
        cout << m << endl;
    }
}

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<=100;x++){
			for(ll y=0;y<=100;y++){
				for(ll z=0;z<=100;z++){
					ll kazu=x+pow(y,2)+pow(z,3);
					if(kazu==num){
						//cout << x << ' ' << y << ' ' << z << endl;
						ans = min(ans,(x+y+z));
					}
				}
			}
		}
		cout << ans << endl;
}
	return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

using namespace std;

inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}

typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EACH(t,i,c) for(t::iretator i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

const double EPS = 1e-10;

int main() {
	int e;

	while(cin >> e, e) {
		int min = INT_MAX;	

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

		cout << min << endl;
	}
}

C++: #include<iostream>

int main(void) {
    int e = 0;
    while(std::cin >> e) {
        int result = 1000000;
        if(e == 0) {
            break;
        }
        for(int z = 0; z <= 100; z++) {
            const int Z = z*z*z;
            if(Z > e) {
                break;
            }
            for(int y = 0; y <= 1000; y++) {
                const int Y = y*y;
                if(Z + Y > e) {
                    break;
                }
                int x = e - Z - Y;
                result = std::min(result, x + y + z);
            }
        }
        std::cout << result << std::endl;
    }
    return 0;
}