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 <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main (int argc, char *argv[]) {
    int e;
    while (cin>>e, e) {
        int m = e;
        for (int z = 0; z * z * z <= e; ++z) {
            for (int y = 0; y * y <= e - z * z * z; ++y) {
                int x = e - y * y - z * z * z;
                m = min(m, x + y + z);
            }
        }
        cout<<m<<endl;
    }
    return 0;
}

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

const int MAX=1000000;

int main(){
  int m,x,y,z,e;

  while(1){
    m=MAX;
    cin>>e;
    if(e==0)break;

    for(x=0;x<=sqrt(MAX/100);x++){
      for(y=0;y<=sqrt(MAX/10);y++){
	for(z=0;z<=sqrt(MAX);z++){
	  if(e==(x+y*y+z*z*z)){
	    m=min(m,(x+y+z));
	    break;
	  }
	}
      }
    }
    cout<<m<<endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int inf = 1 << 28;
//constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;

using namespace std;
typedef unsigned long long ull;
typedef long long ll;

void solve() {
	ll e; scanf("%lld", &e);
	if (e == 0) exit(0);
	ll res = INF;
	for (ll z = 0; z * z * z <= e; z++) {
		ll r = e - z * z * z;
		for (ll y = 0; y * y <= r; y++) {
			ll x = r - y * y;
			chmin(res, x + y + z);
		}
	}
	printf("%lld\n", res);
}
int main()
{
	/*
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	*/
	int kkt = 89;
	while (kkt) {
		solve();
	}
	return 0;

}

C++: #include <stdio.h>
#include <math.h>
#define min(a,b) a > b ? b : a

int main(void){
	int y, z, e, m;
	while(1){
		scanf("%d",&e);
		if(e == 0)
			break;
		m = 0x7FFFFFFF;
		for(z = 0;(int)pow((double)z,3) <= e;z++){
			for(y = 0;(int)pow((double)y + 1,2) <= e - (int)pow((double)z,3);y++);
				m = min((int)(z + y + (e - pow((double)z,3) - pow((double)y,2))),m);
		}
		printf("%d\n",m);
	}
	return 0;
}

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

using namespace std;

int main() {	
	while (true) {
		int e;
		int ans = 1e+9;
		cin >> e;
		if (e == 0) {
			break;
		}
		
		for (int z = 100; z >= 0; z--) {
			for (int y = 1000; y >= 0; y--) {
				int x;
				if (e >= z * z * z + y * y) {
					x = e - z * z * z - y * y;
				}
				ans = min(ans, x + y + z);
			}
		}
		
		cout << ans << endl;
	}
	
	return 0;
}

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

using namespace std;

int main(){
	bool first;
	int min;
	int x, y, z, e,buf_z,buf_y;
	cin >> e;
	while (e != 0){
		first = true;
		for (z = 0; (buf_z = pow(z, 3)) <= e; z++)
		{
			for (y = 0; buf_z + (buf_y = pow(y, 2)) <= e; y++)
			{
				x = e - buf_z - buf_y;
				if (first == true)
				{
					min = x + y + z;				
					first = false;
				}
				else if (min > x + y + z)
				{
					min = x + y + z;
				}
			}
		}
		cout << min << "\n";
		cin >> e;
	}
	return 0;
}

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

int main() {
	int d,e,x1,y1,z1,x2,y2,z2,m,i;
	while(1){
		x1 = y1 = z1 = x2 = y2 = z2 = 0;
		cin >> e;
		if(e == 0)break;
		d = e;
		i = 0;
		while(1){
			i++;
			if((i*i*i) > e)break;
		}
		z1 = i - 1;
		e -= z1 * z1 * z1;
		i = 0;
		while(1){
			i++;
			if(i*i > e)break;
		}
		y1 = i - 1;
		e -= y1 * y1;
		i = 0;
		while(1){
			i++;
			if(i == e)break;
		}
		x1 = i;
		i = 0;
		while(1){
			i++;
			if((i*i) > d)break;
		}
		y2 = i - 1;
		d -= y2 * y2;
		i = 0;
		while(1){
			i++;
			if(i*i*i > d)break;
		}
		z2 = i - 1;
		d -= z2 * z2 * z2;
		i = 0;
		while(1){
			i++;
			if(i == d)break;
		}
		x2 = i;
		m = min(x1+y1+z1,x2+y2+z2);
		cout << m << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cctype>
#define INF 1000000000
using namespace std;
bool debug=false;

int main(){
    int n;
    while(1){
        cin>>n;
        if(n==0)break;
        bool ok=false;
        for(int i=0;i<=100;i++){
            for(int j=0;j<=100;j++){
                for(int k=0;k<=100;k++){
                    if(i+j*j+k*k*k==n){
                        cout<<i+j+k<<endl;
                        ok=true;
                    }
                    if(ok)break;
                }
                if(ok)break;
            }
            if(ok)break;
        }
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;

int main(void) {

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

  }

  return 0;
}

// EOF

C++: #include <iostream>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>
#include <math.h>


using namespace std;

int main(int argc, char const* argv[])
{
    int e;
    while (cin >> e, e) 
    {
        int x,y,z;
        int m = 1000000;

        //for (int i = 0; i <= e; i++) 
        //{
        //    for (int j = 0; j*j <= e; j++) 
        //    {
        //        for (int k = 0; k*k*k <= e; k++) 
        //        {
        //            //cout << " x y z = " << i << j << k <<endl;
        //            if ( i + j*j + k*k*k == e) 
        //            {
        //                m = min( m, i + j + k);
        //            }
        //        }
        //    }
        //}
        for (int k = 0;  k*k*k <= e; k++) 
        {
            int j = sqrt(e - k*k*k);
            int i = e - k*k*k -j*j;
            m = min( m, i + j + k);
        }
        cout << m << endl;
    }
    return 0;
}