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 <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 <= cbrt((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++: #include <iostream>
#include <cmath>
using namespace std;
int main() {
    int e;
    while (cin >> e, e) {
        int ret = 1e6;
        for (int z=0; z*z*z<=e; ++z) {
            int y = (int)pow(e - z*z*z, 1.0/2.0);
            int x = e - z*z*z - y*y;
            ret = min(ret, x+y+z);
        }
        cout << ret << endl;
    }
    return 0;
}

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

using namespace std;

void solve()
{
	int e;
	while(cin >> e, e)
	{
		int min_val = 999999999;
		for(int i = 0; i * i * i <= e; ++i)
		{
			if(i >= min_val)
			{
				break;
			}
			for(int j = 0; j * j <= e; ++j)
			{
				if(i * i * i + j * j > e || i + j >= min_val)
				{
					break;
				}
				for(int k = 0; k <= e; ++k)
				{
					unsigned long long int temp = i * i * i + j * j + k;
					int val = i + j + k;
					if(temp > e || val >= min_val)
					{
						break;
					}
					else if(temp == e)
					{
						if(min_val > i + j + k)
						{
							min_val = i + j + k;
						}
					}
				}
			}
		}
		cout << min_val << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back 
#define pf push_front 
#define mp make_pair
#define fr first
#define sc second
#define Rep(i,n) for(int i=0;i<(n);i++)
#define All(v) v.begin(),v.end()
typedef pair<int, int> Pii; typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;


main()
{
  int e;
  while( cin >> e, e ) {
    /*int m = 0;
    int ans;
    int sum = 0;
    
    for(int i=0; ; i++) {
      if( pow(i, 3) > e ) { sum += pow(i-1, 3); m += i-1; break; }
    }
    
    for(int i=0; ; i++) {
      if( pow(i, 2) > e-sum ) { sum += pow(i-1, 2); m += i-1; break; }
    }
    
    ans =  m + e-sum;
    
    m = sum = 0;

    for(int i=0; ; i++) {
      if( pow(i, 2) > e ) { sum += pow(i-1, 2); m += i-1; break; }
    }
    
    for(int i=0; ; i++) {
      if( pow(i, 3) > e-sum ) { sum += pow(i-1, 3); m += i-1; break; }
    }
    
    cout << min( ans, m + e-sum ) << endl;
    */
    int mi = INF;
    for(int i=0; i<1000; i++) {
      for(int j=0; j<1000; j++) {
	int tmp = j*j + i*i*i;
	if( tmp <= e ) {
	  mi = min( mi, i + j + (e-tmp) ); 
	}
      }
    }

    cout << mi << endl;
    
  }
  
}

C++: #include <iostream>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
using namespace std;
typedef long long  ll;
const int MAX = 10000;

/** Problem2012 : Space Coconut Grab **/
int main()
{
	int e;
	int m=INF;
	
	while (cin>>e, e!=0) {
		m=INF;
		rep(i, 150) {
			rep(j, 150) {
				rep(k, 150) {
					if(i + j*j + k*k*k == e) {
						if (m>i+j+k) {
							m=i+j+k;
						}
					}
				}
			}
		}
		cout << m << endl;
	}
	return 0;
}

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

int solve(int e){
    // int x,y,z;
    int m = INT_MAX;
    for(int y = 0; y<= 1000; y++){
        for(int z = 0; z <= 1000; z++){
            if((z*z*z + y*y) <= e) {
                int x = e - z*z*z -y*y;
                m=min(m, z+y+x);
            }
        }
    }
    return m;
}

int main(void){
    int e;
    vector<int>ans;
    while(1){
        cin>>e;
        if(e==0)break;
        ans.push_back(solve(e));
    }
    for(int m: ans)cout<< m <<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;
}
return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int e;
  while(cin >> e,e){
    int mn = 1000000;
    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);
	int m = x + y + z;
	mn = min(m,mn);
      }
    }
    cout << mn << endl;
  }
  return 0;
}

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

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

#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()
#define mp make_pair
#define pb push_back

using namespace std;

typedef pair<int, int> pii;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;
const int N = (int)1e6 + 1;

int main(void){
    for(int e, res; res = INF, cin >> e, e; cout << res << endl)
        for(int z = 0; z * z * z < N; z ++)
            for(int y = 0; y * y < N; y ++)
                if(y * y + z * z * z <= e)
                    res = min(res, y + z + e - y * y - z * z * z);

    return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const int MILLION = 1000000;
int main(){
    int result;
    int input;
    bool flag=true;
//    priority_queue<int> results;
//    set<int> results;
    vector<int> results;
    while(cin >> input && input){
	for(int i=0; i*i*i<=input; i++){
	    for(int j=0; j*j<=input-i*i*i; j++){
		for(int k=0; k<=input-i*i*i-j*j; k++){
		    if(i*i*i+j*j+k==input)
			results.push_back(i+j+k);
		}
	    }
	}
//	cout << "test" << endl;
	sort(results.begin(), results.end());
	
//	result = *results.begin();
	cout << results[0] << endl;
	results.clear();
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
	int e;
	while(cin>>e){
		if(e==0) break;
		int m=e,x,ct=0;
		for(int z=pow(e,0.333333333333333334)+1;z>=0;z--){
			for(int y=0;y<pow(e-z*z*z,0.5)+1;y++){
				if(e-z*z*z-y*y>=0){
					x=e-z*z*z-y*y;
					m=min(m,x+y+z);
					ct++;
					if(ct>10000){
						goto end;
					}
				}
				else{
					break;
				}
			}
		}
		end:;
		cout<<m<<endl;
	}
    return 0;
}