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>

using namespace std;

int main() {
    int e;
    while (true) {
        cin >> e;
        if (e == 0) {
            break;
        }
        int m = -1;
        for (int z=0, z_3=0; z_3<=e; z++, z_3=z*z*z) {
            for (int y=0, y_2=0; z_3+y_2<=e; y++, y_2=y*y) {
                int x;
                for (x=0; z_3+y_2+x<e; x++);
                if (z_3+y_2+x == e) {
                    if (m > 0) {
                        m = min(m, x+y+z);
                    }
                    else {
                        m = x+y+z;
                    }
                }
            }
        }
        cout << m << endl;
    }
    return 0;
}

C++: #include <cstdio>

int main(){
	int n;
	while(scanf("%d", &n),n){
		int ans = 1000000;
		for(int i = 0; i <= 100; i++){
			for(int j = 0; j <= 1000; j++){
				if(n-i*i*i-j*j >= 0){
					if(ans > i+j+n-i*i*i-j*j) ans = i+j+n-i*i*i-j*j;
				}
			}
		}
		printf("%d\n", ans);
	}
}

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

using namespace std;
int main() {
	int e;
	while(cin >> e && e > 0){
		int min_sum = 100000;
		for(int i = 0; i <= e; i++)
		{
			int j = sqrt(e - i*i*i);
			int k = e - i*i*i - j*j;
			int temp = i + j + k;
			min_sum = min(temp, min_sum);
		}
		cout << min_sum << endl; 
	}	
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int e;
  while(cin>>e,e){
    int ans=1e9;
    for(int z=0;z*z*z<=e;++z)
      for(int y=0;y*y<=e-z*z*z;++y)
        ans=min(ans,z+y+e-z*z*z-y*y);
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
using namespace std;

#define REP(i, s, e) for (int i = (s); i < (e); i++)
#define REPI(i, s, e) for (int i = (s); i <= (e); i++)
#define rep(i, n) REP(i, 0, n)
#define repi(i, n) REPI(i, 0, n)
#define ALL(v) (v).begin(), (v).end()

#define dump(x) (cout << #x << " = " << x << endl)
#define dump2(x, y) (cout << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl)
#define dump3(x, y, z) (cout << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", "<< z << ")" << endl)

typedef long long ll;
typedef pair<int, int> pii;

#define MAX 1000000

int main(void)
{
	int e;
	vector<pii> vs;
	for (int y = 0;; y++) {
		int k = y*y;
		if (k > MAX) break;
		for (int z = 0;; z++) {
			int l = z*z*z;
			if (k+l > MAX) break;
			vs.push_back(pii(k+l, y+z));
		}
	}
	sort(ALL(vs));

	while (cin >> e, e) {
		int ans = (1<<29);
		for (int x = 0; x <= max(e/3+1, 3); x++) {
			int e_x = e - x;
		
			int a = 0, b = vs.size();
			while (b - a > 1) {
				int m = (a+b)/2;
				if (vs[m].first >= e_x)
					b = m;
				else
					a = m;
			}
			if (vs[b].first == e_x)
				ans = min(ans, x+vs[b].second);
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main(){
  int e;
  while(cin >> e, e){
    int ans = e+1;
    for(int i = 0 ; i*i*i <= e ; i++){
      for(int j = 0 ; j*j <= e-i*i*i ; j++){
	int k = e-i*i*i-j*j;
	ans = min(ans, i+j+k);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>

using namespace std;

#define MAX_N 128;

int ans;


int main()
{
    int e;
    
    int ans = 100000000;;
    int temp = 10000000;
    
    
    while(cin >> e && e)
    {
        ans = 100000;
        for(int z=0; z<=100; ++z)
        {
            for(int y=0; y<=1000; ++y)
            {
                
                int m = (e-pow(y,2)-pow(z,3)) + pow(y, 2) + pow(z, 3);
                if(m == e)
                {
                    int x = e-pow(y,2)-pow(z,3);
                    if(x < 0){break;}
                    temp = x+y+z;
                    if(ans > temp){ans = temp;}
                }
            }
        }
        cout << ans << endl;
    }
}

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

using std::cin;
using std::cout;
using std::endl;

int limit(int lim, int exp) {
	int res = 0;
	if (exp > 1) {
		for (int i = 2; pow(i,exp) < lim+1; i++) {
			res = i;
		}
	}
	else {
		for (int i = 0; pow(i,exp) < lim+1; i++) {
			res = i;
		}
	}
	return res;
}

int main(void) {
	int e;
	cin >> e;

	while (e != 0) {
		int lim = 0;
		int m = 0;
		int n = 0;
		int en = e;
		int temp;

		temp = limit(en,3);
		lim += temp;
		en -= pow(temp,3);

		temp = limit(en,2);
		lim += temp;
		en -= pow(temp,2);

		temp = limit(en,1);
		lim += temp;
		m = lim;

		for (int x = 0; x < lim; x++) {
			for (int y = 0; y < (lim-x); y++) {
				for (int z = 0; z < (lim-x-y); z++) {
					n = x + y + z;
					if (n < m) {
						if ((x+pow(y,2)+pow(z,3))==e) {
							m = n;
						}
					}
				}
			}
		}
		
		cout << m << endl;
		cin >> e;
	}
	return 0;
}

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

int main(void){

  int e;

while(1){
    int ans = 1000000000;
    cin >> e;
    
    if(e == 0) break;
    for(int x=0; x <= sqrt(e); x++){
      for(int y=0; y <= 173; y++){
	for(int z=0;z <= 100; z++){
	  if(e == x + y*y + z*z*z){
	    ans = min(ans,x+y+z);
	    //cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }
    }

    cout << ans << endl;

 }
  return 0;
}

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

typedef long long ll;

ll e, m, x, min_;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    while (cin >> e, e) {
        min_ = m = (int)(1e9 + 7);

        for (int y = 0; y <= sqrt((double)e); y++) {
            for (int z = 0; z <= sqrt((double)e); z++) {
                x = e - y * y - z * z * z;
                if (x < 0) break;
                else {
                    m = x + y + z;
                    //cout << "x, m = " << x << " " << m << endl;
                    if (min_ > m) min_ = m;
                }
            }
        }

        cout << min_ << endl;
    }

    return 0;
}

C++: n,i,j;
#define rep(i,a) for(i=0;i<a;i++) 
main(){
	while(scanf("%d",&n),i=0,n){
		int mi=999;
		rep(i,110)rep(j,1010)mi=fmin(mi,(n<i*i*i+j*j?999:i+j+n-i*i*i-j*j));
		printf("%d\n",mi);
	}
}

C++: #include <iostream> 
#include <math.h> 
using namespace std;  
int e,x;
int min_mum = 0;

int solve (){
	min_mum = e;
	for (int z=0; z<=pow(e, 1.0/3); ++z){
		for (int y=0; y<=sqrt(e - z*z*z); ++y){
			x = e- z*z*z - y*y;
			if (x+y+z < min_mum && x>=0){
				min_mum = x+y+z;
			}	 
		}
	}
	return min_mum;
	
}

int main()  
{     
	while (cin >> e && e > 0){
		cout << solve() << endl;
	}        
	
	return 0;  
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int x,y,z;
int e;
int solve(){
	z =  (int)(pow (e,1/3));
	y = (int)(sqrt(e - pow(z, 3)));
	x = e - pow(z, 3)-pow(y, 2); 
	int minnum = x+y+z;
	return minnum;
};
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 "bits/stdc++.h"
using namespace std;

int main() {
	long long E;
	while (cin >> E) {
		if (E == 0) return 0;
		long long ANS = 1000000000;
		for (long long C = 0; C * C * C <= E; C++) {
			long long D = E - C * C * C;
			long long B = sqrt(D);
			long long A = D - B * B;
			ANS = min(ANS, A + B + C);
		}
		cout << ANS << endl;
	}
}