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 <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cassert>

using namespace std;


bool solve(){
	int n;
	cin>> n;
	if(!n) return false;
	int ans = 1000000;
	for(int k=n;k>=0;k--){
		if((long long)k*k*k > n) continue;		//long long
		for(int j=n;j>=0;j--){
			if((long long)j*j + (long long)k*k*k > n) continue;		//
			int i = n - j*j - k*k*k;
			if(0 <= i && i <= n){
				int m = i+j+k;
				ans = min(ans, m);
			}
		}
	}
	cout<< ans<< endl;
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	while(solve());

	return 0;
}

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

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

C++: #include <iostream>
#include <climits>
using namespace std;
int main() {
    int e;
    while (cin >> e, e) {
        int mx = INT_MAX;
        for (long long z=0; z*z*z<=e; ++z) {
            for (long long y=0; y*y+z*z*z<=e; ++y) {
                long long x = e - z*z*z - y*y;
                if (x + y + z < mx) {
                    mx = x + y + z;
                }
            }
        }
        cout << mx << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 30;
// S N E W(南北東西)
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

typedef unsigned long long ull;
typedef std::pair<int,int> P;
typedef std::pair<int,P> State;

int pow(int a, int n){
    int res = 1;
    while(n > 0){
        if(n & 1){res *= a;}
        a *= a;
        n >>= 1;
    }
    return res;
}

int bs(int a, int n){
    int lb = 0, ub = 1001;
    while(ub-lb > 1){
        int mid = (lb+ub) / 2;
        if(pow(mid, n) <= a){
            lb = mid;
        }else{
            ub = mid;
        }
    }

    return lb;
}


int main(){
    int e;
    while(std::cin >> e, e){
        int res = INF;
        REP(z, 101){
            if(e-z*z*z >= 0){
                int y = bs(e-z*z*z, 2),
                    x = e - z*z*z - y*y;
                res = std::min(res, x+y+z);
            }
        }

        std::cout << res << std::endl;
    }
}

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

int f(int x,int y,int z){
	return x+y*y+z*z*z;
}
int main(void){
	int x,m,e;

	while(cin>>e,e){
		m=1000000;
		// x+yy+zzz=e????§£???.
		for(int y=0;y*y<=e;y++){
			for(int z=0;y*y+z*z*z<=e;z++){
				// if(y*y+z*z*z>e)goto lab;
				// printf("debug:%d\n",f(x,y,z));
				x=e-y*y-z*z*z;
				if(m>x+y+z)m=x+y+z;
			}
		}
lab:
		cout<<m<<endl;
	}
}

C++: //Space Coconut Grab
//????????????30???
//x??¨y????±?????????????z????±???????????????????????????????????????????????????£??????
//???????????????????????´??????y??¨???????±?????????????x????±???????????????????????????????????°??????????????????????

#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;

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

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

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

int main(){
  int i,j,k,e,x,y,z,m;
  while(1){
    int min=1000000;
    cin >> e;
    if(e==0)break;
   
    for(x = 0; x <= 1000; x++){
      for(y = 0; y <= 1000; y++){
	for(z = 0; z <= 1000; z++){
	  if(x+y*y+z*z*z==e){
	    m=x+y+z;
	    if(m<min)min=m;
	    // cout << m << endl;
	  }
	}
      }
    }
     cout << min << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <iterator>
#include <limits>
#include <numeric>
#include <utility>
#include <cmath>
#include <cassert>
#include <cstdio>

// #include <unordered_set>
// #include <unordered_map>

#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())

#define pb push_back
#define mp make_pair

int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}

typedef std::pair<int, int> P;
typedef long long ll;
typedef long double ld;

const int MOD = 1000000007;
const int INF = 1e9;
const ll LINF = INF * 1ll * INF;
const ld DINF = 1e200;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

using namespace std;

#define int long long

signed main(){
  

    ios::sync_with_stdio(false);
    cin.tie(0);
    //cin高速化

    int e;



    while(cin>>e){

        int ans=INF;

        if(e==0)break;

        REP(i,1000000){
            REP(j,1000){
                REP(k,100){

                    // cout<<i<<" "<<j<<" "<<k<<endl;
                    if(i>e||j>e||k>e)break;
                    if(i+j*j+k*k*k==e){
                        ans=min(i+j+k,ans);
                    }
                }
            }
        }

        cout<<ans<<endl;


    }
    
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	int e;
	while (cin >> e, e) {
		int m=20000000;
		int x, y, z;
	
		for (z = 0; (int)pow(z, 3) <= e; z++) {
			for (y = 0; (int)pow(y, 2) + (int)pow(z, 3) <= e; y++) {
				x = e - ((int)pow(y, 2) + (int)pow(z, 3));
				m = min(m, x + y + z);
			}
		}
		cout << m << endl;

	}
	return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
typedef long long ll;
int prime(int x) {
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (int i = 3; i*i <= x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}
int main() {
	int e;
	while (scanf("%d", &e), e) {
		int m = 10000000000000000;
		for (int y = 0; y <= 10000; y++) {
			for (int z = 0; z <= 10000; z++) {
				int x=e + y - y * y + z - z * z * z;
					if(x>=0&&e>=y*y+z*z*z)m = min(x,m);
			}
		}
		cout << m << endl;
	}
}

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