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 <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a, b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define show(x) cout <<#x<<" = "<<(x)<<endl
#define spair(p) cout <<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<endl
#define sset(s) cout<<#s<<":";each(i,s)cout <<" "<<i;cout<<endl

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

int main()
{
    while(1){
        int e;
        cin >> e;
        if(e == 0){
            break;
        }
        int z = 0;
        while(z*z*z <= e){
            z++;
        }
        int ans = INF;
        for(int i=max(0,z-5);i<z;i++){
            int rem = e - i*i*i;
            int y = 0;
            while(y*y <= rem){
                y++;
            }
            for(int j=max(0,y-10);j<y;j++){
                int x = rem - j*j;
                ans = min(ans,x+i+j);
            }
        }
        cout << ans << "\n";
    }

}

C++: #include <iostream>

using namespace std;

int main()
{
  int e;
  while (cin >> e && e) {
    int m = 1 << 30, tmp;
    for (int x = 0; x <= 1000000 && x <= e;  x++) {
      for (int y = 0; y <= 1000 && (x + y * y) <= e; y++) {
        for (int z = 0; z <= 100 && (x + y * y + z * z * z) <= e; z++) {
          if ((x + y * y + z * z * z) == e)
            m = min(m, x + y + z);
        }
      }
    }
    cout << m << endl;
  }
}

C++: #include <bits/stdc++.h>

#define FOR(i, a, b) for(long long int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;



int main(void) {
	
	while (1) {
		int e;
		bool flag = true;
		int mini = INF;

		cin >> e;
		if (e == 0) {
			break;
		}
		RFOR(z, cbrt(e)+1, 0) {
			if (pow(z, 3) > e) {
				continue;
			}
			RFOR(y, sqrt(e-pow(z,3))+1, 0) {
				if (pow(y, 2) > e - pow(z, 3)) {
					continue;
				}
				if (pow(y, 2) == e - pow(z, 3)) {
					mini = z + y;
					flag = false;
					break;
				}
				else {
					if (mini > z + y + e - pow(z, 3) - pow(y, 2)) {
						mini = z + y + e - pow(z, 3) - pow(y, 2);
					}
					break;
				}
			}
			if (flag == false) {
				break;
			}
		}
		cout << mini << endl;
	}

}

C++: #include <iostream>

using namespace std;

int main(void)
{
	int e;
	int x,y,z;
	int min;

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

		min = e;
		for(z=0;z*z*z<=e;z++){
			for(y=0;y*y<=e-z*z*z;y++){

				x = e - z*z*z - y*y;

				if(min>(x+y+z)){
					min = (x+y+z);
				}
			}
		}

		cout << min << endl;
	}


	return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	long long x, y, z, e, m;
	while (cin >> e&&e != 0) {
		m = 1000000000000000000;
		for (z = ceil(sqrt(e)); z >= 0; z--) {
			if (z*z*z <= e) {
				for (y = ceil(sqrt(e - z*z*z)); y >= 0; y--) {
					if (z*z*z + y*y <= e) {
						x = e - z*z*z - y*y;
						m = min(x + y + z, m);
					}
				}
			}
		}
		cout << m << endl;
	}
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int solve(int E)
{
    int ans=3*E;
    for(int x=0;x<=E;++x)
        for(int y=0;y<=(int)round(pow(E-x,1.0/2));++y)
            for(int z=0;z<=(int)round(pow(E-x-y*y,1.0/3));++z)
            {
                if(x+y*y+z*z*z==E)
                {
                    if(x+y+z<ans)
                        ans=x+y+z;
                }
            }
    return ans;
}
int main()
{
    int E;
    while(cin>>E&&E>0)
        cout<<solve(E)<<endl;
}

C++: #include <iostream>
#define REP(i, a, n) for(int i = (a); i < (n); i++)
using namespace std;

int E;

int main(void) {
  while(cin >> E, E) {
    int ans = 100000000;
    REP(z, 0, 100) {
      int z3 = z * z * z;
      if(z3 > E) break;
      REP(y, 0, 1000) {
        int y2 = y * y;
        int x = E - z3 - y2;
        if(x < 0) continue;
        ans = min(ans, x + y + z);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

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

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

int main() {
	long long e,x,y,z,min,k;
	for (;;) {
		x = y = z = k = 0, min = 1000000;
		cin >> e;
		if (e == 0) return 0;
		for(int i=0;i<sqrt(e);i++)
			for (int j = 0; j < pow(e,1.0/3.0); j++) {
				k = e - i*i - j*j*j;
				if (k>=0&&min > i + j + k) {
					min = i + j + k;
					x = k, y = i, z = j;
				}
			}
		cout << x + y + z << endl;
	}
	return 0;
}

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

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