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 <stdio.h>
#include <iostream>
#include <queue>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#define PB push_back
#define in scanf
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
using	namespace std;
void solve(){
	int e;
	while(cin >> e ,e!=0) {
	int m =1000000000;
	int x;
	for(int z=0;z*z*z<=e;z++){
		for(int y=0;y*y+z*z*z<=e;y++){
			x = e-y*y-z*z*z;
			m = min(x + y + z,m);
			
				
		}
	}
	cout << m  << endl;
	
}
}



	
int main(){
	solve();

}

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

int e,minimum;

int solve(){
    minimum = e;
    for(int z=0;z <= pow(e,1./3.);z++){
        for(int y=0;y <= sqrt(e);y++){
            int x = e - z*z*z - y*y;
            if(x>=0)
                minimum = min(x+y+z,minimum);
        }
    }
    return minimum;
}

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

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

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

  vector<int> v(1000001,1 << 30);
  const int n = 110;
  for(int x = 0; x < n; x++){
    for(int y = 0; y < n; y++){
      for(int z = 0; z < n; z++){
        if(x + y*y + z*z*z > 1000001) continue;
        v[x + y*y + z*z*z] = min(v[x + y*y + z*z*z],x + y + z);
      }
    }
  }

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

  cout << v[e] << endl;
}

  return 0;
}

C++:     #include <bits/stdc++.h>
    #define REP(i,n) for(int i = 0; i < (int)(n); ++i)
    using namespace std;

    int main(){
        int x = 0, y = 0, z = 0;
        int m = 1000000, e = 0;
        while(cin >> e && e > 0){
            z = 0;
            while(z*z*z <= e){
                z++;}
            z--;
            REP(i,z+1){
                y = 0;
                while(y*y <= e-i*i*i){
                    y++;
                }
                y--;
                x = e - y*y - i*i*i;
                m = min(x+y+i,m);
            }
            cout << m << endl;
            m = 1000000;
        }
        return 0;
    }

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

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

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
	int e;
	while (scanf("%d", &e), e)
	{
		int res = e;

		int z_max = pow(e, 1.0 / 3) + 1;
		int y_max = (int)sqrt(e + 0.0) + 1;
		for (int z = 0; z <= z_max; ++z)
		{
			for (int y = 0; y <= y_max; ++y)
			{
				int x = e - (z*z*z + y*y);
				if (x >= 0)
					min_swap(res, x + y + z);
				else
					break;
			}
		}
		printf("%d\n", res);
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <unordered_set>
#include <algorithm>
using namespace std;

typedef long long ll;

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

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

using namespace std;

int main()
{
    while (true) {
        const int e = [] {
            int e;
            cin >> e;
            return e;
        }();
        if (e == 0) {
            return 0;
        }

        int min_ = 1'000'000 + 1;
        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;
                if (x >= 0) {
                    min_ = min(min_, x + y + z);
                }
            }
        }
        cout << min_ << endl;
    }
}

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

using namespace std;

inline int cubic(int x){
    return x*x*x;
}

inline int square(int x){
    return x*x;
}

int main(){
    int n;
    while(cin >> n && n){
        int ret = 1 << 29;
        for(int i=0;cubic(i)<=n;i++){
            int tmp = n - cubic(i);
            for(int j=0;square(j)<=tmp;j++){
                ret = min(ret, i+j+tmp-square(j));
            }
        }
        cout << ret << endl;
    }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int Bsearch(int n,int e){
  if(e==1)return 1;
  int s,t;
  s=0;t=e;
  int x=e/2;
  while(t-s>1){
    if(pow(x,n)<e){
      s=x;
    }else if(pow(x,n)>e){
      t=x;
    }else{
      break;
    }
    x=(s+t)/2;
  }
  return x;
}
 
int main(){
  int e;
  while(cin>>e){
    if(e==0)break;
    int x=Bsearch(3,e);
    int y=Bsearch(2,e);
    int minim=1000;
    for(int i=0;i<=x;i++){
      int z=pow(i,3);
      for(int j=0;j<=y;j++){
	int x=e-z-j*j;
	if(x<0)break;
	minim=min(minim,i+j+x);
      }
    }
    cout << minim << endl;
  }
  return 0;
}

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

int main(){

  while(cin >> E && E > 0 ){
    int min = 1000001; 
    for (int z = 0; z < E; ++z){
      for (int y = 0; y*y < E - z*z*z ; ++y){
        int x = E - z*z*z - y*y;
        if( x + y + z < min ) min = x + y + z ;
      }
    }
    cout << min << endl;
  }
return 0;
}

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, 0, 1000) {
			REP(j, 0, 1000) {
				if (e-i*i-j*j*j >= 0) {
					int t = e-i*i-j*j*j + i + j;
					if (t<m)
						m = t;
				}
			}
		}
		cout << m << endl;
	}
	return 0;
}

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

#define MAX 1000000
int min(int a, int b);

int min(int a, int b) {
    if (a > b)
        return b;
    else
        return a;
}
int main()
{
    while (1)
    {
        int y, z, e, ans = MAX;
        cin >> e;
        if (!e)
            break;
        for (z=0; z*z*z <= e; z++) {
            y = (int)sqrt((double)e - z*z*z);
            ans = min(ans, e - y*y - z*z*z + y + z);
        }
        cout << ans << endl;
    }
    return 0;
}