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>
#define int long long
using namespace std;
int E;
int solve(int e){
    int min = e;
    for(int z=0; z*z*z<=e; z++){
        for(int y=0; y*y<=e-z*z*z; y++){
            int x = e - z*z*z - y*y;
            min = (min < x+y+z)? min: x+y+z;
        }
    }
    return min;
}
signed main(){
    while(cin >> E && E > 0){
        cout << solve(E) << endl;
    }
}

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

typedef long long ll;

ll e, m, tmp;

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

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

        for (int y = 0; y <= sqrt((double)e); y++) {
            for (int z = 0; z <= cbrt((double)e); z++) {
                tmp = e - y * y - z * z * z;
                if (tmp < 0) break;
                else {
                    tmp += y + z;
                    if (m > tmp) m = tmp;
                }
            }
        }

        cout << m << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 1000000;
    for (int z=0; z<=100; z++){
      for(int y=0; y<= fmin(E-pow(z,3),1000);y++){
	int x = E - pow(z,3) - pow(y,2);
	if (x>=0){
	  int n = x+y+z;
	  if(n < m && m > 0){
	    m = n;
	  }
	}
      }
    }
    cout << m << endl;
  }
}

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

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { os << p.first << ' ' << p.second; return os; }

void solve() {
  while (true) {
    int e; cin >> e;
    if (e == 0) return;
    int ans = 1e9;
    for (int z = 0; z * z * z <= e; z++)
    for (int y = 0; y * y <= e; y++) {
      int x = e - (z * z * z + y * y);
      if (x < 0) break;
      amin(ans, x + y + z);
    }
    cout << ans << '\n';
  }
}

C++: #include <iostream>
#include <math.h>

using namespace std;

int main(){
	bool first;
	int min;
	int x, y, z, e,buf_z,buf_y;
	cin >> e;
	while (e != 0){
		first = true;
		for (z = 0; (buf_z = pow(z, 3)) <= e; z++)
		{
			for (y = 0; buf_z + (buf_y = pow(y, 2)) <= e; y++)
			{
				x = e - buf_z - buf_y;
				if (first == true)
				{
					min = x + y + z;				
					first = false;
				}
				else if (min > x + y + z)
				{
					min = x + y + z;
				}
			}
		}
		cout << min << "\n";
		cin >> e;
	}
	return 0;
}