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 <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi acos(-1.0)
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

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

    return 0;
}

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

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

C++: #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
const long long INF = 100000000;
using namespace std;

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

C++: #include<iostream>
#include<math.h>
//#include<limits.h>
using namespace std;
int solve(int E)
{
  int ans =999999;
  for (int z=0; z*z*z<=E; z++)
    for (int y=0; y*y<=E; y++)
      {
	//cout<<"z="<<z<<" y="<<y<<endl;
	int x=E-z*z*z-y*y;
	//cout<<"x="<<x<<endl;
	//cout<<"x+y*y+z*z*z="<<x+y*y+z*z*z<<endl;
	if ((x+y*y+z*z*z == E)&&(x>=0))
	{

	  if((x+y+z)<ans)
	  {
	    ans=x+y+z;
	    //cout<<"ans="<<ans<<endl;
	  }
	}
      }
  return ans;
}
int main()
{
  int E;
  while (cin >> E && E>0)
  {
    cout << solve(E) << endl;
  }
}

C++: #if 0
xy??§???AOJ??????????????¢????????§??????????????£???
#endif

#include <iostream>
#include <cmath>
using namespace std;

int mycount = 0; // ambigous??¨???????????????????????????
int solve(int E) {
	int ans = 1000000;
	for (int x=0; x<=E; ++x)
		for (int y=0; y*y<=E; ++y){
			int z = (int)round(pow(E-x-y*y,1.0/3));
				++mycount; 
				if (z>0 && 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>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

void solve(int E) {
    int m = INF;
    for (int y = 0; (y * y) <= E; y++) for(int z = 0; (y * y) + (z * z * z) <= E; z++) {
        int x = E - (y * y) - (z * z * z);
        m = min(m, x + y + z);
    }
    cout << m << endl;
}

signed main(void) {
    int n, m, p, a, b, c, x, y, z, q;
    string s;
    while (cin >> n, n) {
        solve(n);
        //return 0;
    }
}

C++: #include <cstdio>
#include <cmath>

#define MAX 1000000

int main(void) {
	while(1) {
		int e, y, z, ans = MAX;

		scanf("%d", &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);
		}
		printf("%d\n", ans);
	}
	return 0;
}

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

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

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int e;
int main(){
	while(cin>>e,e){
		int ans=10000000;
		for(int z =0;z*z*z<=e;z++){
			for(int y =0;y*y+z*z*z<=e;y++){
				int x =e-y*y-z*z*z;
				if(ans >x+y+z){
					ans =x+y+z;
				}
			}
		}
		cout <<ans<<endl;
	}
	return 0;
}

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

int main()
{
    int e;
    int x;
    while(1){
        cin >> e;
        int sum = e;
        if(e == 0){
            break;
        }
        for(int z = 0; z * z * z <= e; z++){
            for(int y = 0; z * z * z + y * y <= e; y++){
                x = e - (z * z * z + y * y);
                if(x + y + z < sum){
                    sum = x + y + z;
                }
            }
        }
        cout << sum << endl;
    }
    return 0;
}

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

int main(void){

  int e;

while(1){
    int ans = 1000000000;
    cin >> e;
    
    if(e == 0) break;
    for(int x=0; x <= 117; x++){
      for(int y=0; y <= 172; y++){
	for(int z=0;z <= 100; z++){
	  if(e == x + y*y + z*z*z){
	    ans = min(ans,x+y+z);
	    //cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }
    }

    cout << ans << endl;

 }
  return 0;
}

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

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