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 rep(i, n) for (int i = 0; i < (int)(n); i++)
# define irep(i, n) for (int i = int(n) - 1; i >= 0; i--)
# define FOR(i, m, n) for (int i = int(m); i < (int)(n); i++)

using namespace std;

template <typename T>
void show_all(T t) {
  rep (i, t.size()) {
    rep (j, t[0].size()) {
      cout << t[i][j];
    }
    cout << endl;
  }
}

int main() {
  int e;
  while (cin >> e && e) {
    // int i;
    // int x, y, z;
    // for (i=0; pow(i, 3) <= e; i++) {}
    // z = i-1;
    // e -= pow(z, 3);
    //
    // for (i=0; pow(i, 2) <= e; i++) {}
    // y = i-1;
    // e -= pow(y, 2);
    //
    // x = e;
    //
    // cout << x << ' ' << y << ' ' << z << ' ' << x + pow(y,2) + pow(z, 3) << ' ' << x + y + z << endl;

    int ans = 10000000 + 7;

    for (int z=0; pow(z,3)<=e; z++) {
      for (int y=0; pow(z,3)+pow(y,2)<=e; y++) {
        int x = e - (pow(z,3)+pow(y,2));
        if (x + pow(y,2) + pow(z,3) != e) continue;

        ans = min(ans, x+y+z);
        // cout << x << ' ' << y << ' ' << z << ' ' << x + pow(y,2) + pow(z, 3) << ' ' << x + y + z << endl;
      }
    }
    cout << ans << endl;
  }
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2012&lang=jp>
 問題文============================================================
 =================================================================
 解説=============================================================
 
 x+y*y+z*z*z = e
x = e - y*y - z*z*z >= 0
 ================================================================
 */

ll solve(ll e){
    ll res = LINF;
    for(ll y = 0; y*y <= e; y++){
        for(ll z = 0; z*z*z <= e; z++){
            ll x = e - y*y - z*z*z;
            if(x >= 0) res = min(res,x+y+z);
        }
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    int e;
    while(cin >> e,e){
        cout << solve(e) << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
  int E,tmp,z,y,x,i;
  cin >> E;
  if (E<0 || E>1000000){
    cout << "Incorrect input" << endl;
    exit(1);
  }
  for (i=0;i*i*i<E;i++){
  }
  i--;
  z=i;
  tmp = E-z*z*z;
  for (i=0;i*i<tmp;i++){
  }
  i--;
  y=i;
  x=tmp-y*y;
  cout << x+y+z << endl;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<map>
#include<cmath>
#include<queue>	
#include<functional>
#include<climits>

using namespace std;

namespace MyLib {

//define
#define ALL(a) a.begin(),a.end()
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define debug(x) if(1)cout<<#x<<":"<<x<<endl;
#define DEBUG(x) if(1)cout<<#x<<":"<<x<<endl;
#define ll long long

//constant
const int MOD = 1000000007;
const int INF = INT_MAX / 3-1;
const double EPS = 1e-9;
const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };

//typedef
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

}

using namespace MyLib;



int main() {
	int e;
	while (cin >> e, e) {
		auto ans = tuple<int, int, int>(INF, INF, INF);
		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 + y + z < get<0>(ans) + get<1>(ans) + get<2>(ans))
					ans = make_tuple(x, y, z);
				
			}
		cout << get<0>(ans) + get<1>(ans) + get<2>(ans) << endl;

	}

	return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
  int ene;
  for (int i=0; cin >> ene && ene>0; i++){
    int min = 1000000;
    int z=0;
    while (z<=100) {
      int xy = e - z^3;
      int y=0;
      while (y<xy) {
	int x = xy - y^2;
	if (x+y+z<min) min = x+y+z;
      }
    }
    cout << min << endl;
  }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int x,y,z;
int e;
int solve(){
	z=  (int)pow (e,1/3);
	y = (int)sqrt(e - pow(z, 3));
	x = (int)(e - pow(z, 3)-pow(y, 2)); 
	return x+y+z;
};
int main(){
	int A[100000];
    int k = 0;
	while( cin>>e && e>0 )
	{
		A[k]=solve();
        k++;
	}
	for(int l = 0;l < k; l++)
    {
        cout<<A[l]<<endl;
    }
	return 0;
}

C++: #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
  int E,tmp,z,y,x,i;
  cin >> E;
  if (E<0 || E>1000000){
    cout << "Incorrect input" << endl;
    exit(1);
  }
  for (i=0;i*i*i<E;i++){
  }
  i--;
  z=i;
  tmp = E-z*z*z;
  for (i=0;i*i<tmp;i++){
  }
  i--;
  y=i;
  x=tmp-y*y;
  cout << "E = " << E << endl;
  cout << "(x,y,z) = (" << x << "," << y << "," << z << ")" << endl;
  cout << "x+y+z = " << x+y+z << endl;
}

C++: #include <cstdio>

int main(void)
{
    int e;
    int x, y, z, xyz;
    while(scanf("%d", &e), e != 0){
        for(xyz = 1; xyz <= e; xyz++){
            for(z = 0; z <= xyz; z++){
                for(y = 0; z + y <= xyz; y++){
                    x = xyz - z - y;
                    if(x + y * y + z * z * z > e){
                        break;
                    }else if(x + y * y + z * z * z == e){
                        printf("%d\n", xyz);
                        z = xyz = e;
                        break;
                    }
                }
            }
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

int main() {
  const int N = 1000000;
  int table[N+1];
  REP(i,N+1)
    table[i] = INF;
  REP(i,1001) {
    for (int j=0; i*i+j*j*j<=N; ++j) {
      table[i*i+j*j*j] = min(table[i*i+j*j*j], i+j);
    }
  }
  int n;
  while(cin>>n,n) {
    int res = INF;
    REP(i,n+1) {
      if (table[n-i] != INF) {
        res = min(res,  table[n-i] + i);
      }
    }
    cout << res << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
int e;
int x,y,z;
int minm;
while(true){
cin>>e;
if(e==0)break;
minm=1000000;
for(int i=0;i<1001;i++){
	for(int j=0;j<101;j++){
		for(int k=0;k<101;k++){
			if(e==(i+j*j+k*k*k))minm=min(minm,i+j+k);
		}
	}
}
cout<<minm<<endl;
}
return 0;
}

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

#define pb         push_back

const int INF = 100000000;

int main(void) {
	int e;
	while(cin >> e, e){
		int x, y, z;
		int ans = INT_MAX;

		for(int i=0; i<=1000; i++){
			for(int j=0; j<=100; j++){
				x = e - i*i - j*j*j;
				if(x >= 0){
					ans = min(ans, x + i + j);
				}
			}
		}

		cout << ans << endl;
	}
	
	return 0;
}