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 <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
 
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
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 hoge(int e){
  int num;
  int a,b,c;
  for(a=0;a<=e;a++){
	for(b=0;b<=1000;b++){
	  for(c=0;c<=100;c++){
		num = a + b*b + c*c*c;
		//		cout << num << endl;
		if(num > e) break;
		if(num == e) return (a + b + c);
		
	  }
	}
  }  
	return -1;
}

int main(){
  while(1){
	int e;
	cin >> e;
	if(e==0) break;

	cout << hoge(e) <<endl;

  }
}

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


int main()
{
    int min, E, x;
    cin >> E;
    min = E;
    for (int i = 0; i *i*i <= E;i++) {
        for (int j = 0; i*i*i+j*j <= E; j++) {
            x = E - i*i*i - j*j;
            if (min >= x + i + j)
                min = x + i + j;
            else
                continue;
        }
    }
    cout << min << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
	int N;
	while( cin >> N, N ) {
		long long int ans = LLONG_MAX;
		for( long long int x = 0; x*x*x <= N&&x <= ans; x++ ) {
			for( long long int y = 0; x*x*x + y*y <= N&&x + y <= ans; y++ ) {
				ans = min( ans, x + y + N - x*x*x - y*y );
			}
		}
		cout << ans << endl;
	}
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main() {
int e;
int x,y,z;
while(1){
int sum=0;
cin>>e;
if(e==0) break;
for (z=int(cbrt(e));z>=0;z--){
  for (y=int(sqrt(e-z*z*z));y>=0;y--){
  x=e-y*y-z*z*z;
  if(sum>x+y+z||sum==0){
    sum=x+y+z;
  }
  }
}
cout<<sum<<endl;
}
}

C++: #include <vector>
#include <list>
#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>
#include <cassert>
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 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;
const double PI  = acos(-1.0);

int main(){
	int e;
	while(cin>>e,e){
		int ans=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-y*y-z*z*z;
				ans=min(ans,x+y+z);
			}
		}
		cout<<ans<<endl;
	}
}

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

int main(){
    int e;
    while(scanf("%d", &e), e != 0){
        int ans = e;
        int k;
        for(int z = 0; (k = e - z * z * z) >= 0; ++z){
            int y = (int)(sqrt(k));
            int x = k - y * y;
            ans = min(ans, x + y + z);
        }
        printf("%d\n", ans);
    }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int n;
    while(cin >> n, n){
        int ans = INF<int>;
        for (int y = 0; y*y <= n; ++y) {
            int yy = y*y;
            for (int z = 0; z*z*z+yy <= n; ++z) {
                ans = min(ans, y+z+n-yy-z*z*z);
            }
        }
        cout << ans << "\n";
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
while(1){//start
	
	int e;
	int ans = 100000000;
	//cin >> e;
	scanf("%d", &e);
	
	if(e == 0)break;
	
	int y_lim = 1000;
	if(e * e < 1000) y_lim = e * e;
	int z_lim = 100;
	if(e * e * e < 100) z_lim = e * e * e;
	
	for(int x = 0; x < e; x++){
		for(int y = 0; y <= y_lim; y++){
			if(x + y*y > e) break;
			for(int z = 0; z <= z_lim; z++){
				if(x + y*y + z*z*z > e) break;
				else if(x + y*y + z*z*z == e){
					ans = min(ans, x + y + z);
				}
			}
		}
	}
	
	//cout << ans << endl;
	printf("%d\n", ans);
	
}//ebd	
	return 0;
}

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

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int a;
    while(cin>>a){
        if(a==0){
            break;
        }
        int Z=0,Y=0,X=0,z=0,y=0,m=10000000;
        for(z=0;pow(z,3)<=a;z++){
            Z=pow(z,3);
            for(y=0;pow(y,2)<=a-Z;y++){
                Y=pow(y,2);
            }
            X=a-Y-Z;
            if(X+y+z-2<m){
                m=X+y+z-1;
            }
        }
        cout<<m<<endl;
    }
    return 0;
}

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


int main() {
	int e;
	while (cin >> e && e>0) {
		int y=0;
		int z=0;
		int sum=0,summin=e; // min: NOTICE how we initialize it

		while (y*y+z*z*z<=e) { // third power of something
			while (y*y+z*z*z<=e) {
				int x= e-y*y-z*z*z;
				sum = x+y+z;
				if (sum < summin) summin = sum;
				cout << y << " " << z << endl;
				++z;
			}
			++y;
		}
		cout << summin << endl;
	}

	return 0;
}

C++: 
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <stdlib.h>
#include <math.h>
#include <list>
#include <algorithm>

using namespace std;

int main(void){
	//FILE* fp_in = freopen("data.txt", "r", stdin);

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

	//while(1){}
	return 0;
}

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

using namespace std;

int main( void )
{
	int e;
	while(cin >> e, e) {
		bool hit = false;
		int answer = 1000001;
		for(int z=100; z > -1 && !hit; --z) {
			int sum_z = z * z * z;
			if(sum_z == e) { answer = min(answer, z); continue; }
			else if(sum_z > e) continue;
			else {
				int y = (int)sqrt((double)(e - sum_z));
				int sum_zy = sum_z + y * y;
				answer = min(answer, (z + y + e - sum_zy));
			}
		}
		cout << answer << endl;
	}
	return 0;
}