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 <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <cstdio>
#define rep(i, j) for(int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
using namespace std;
int main()
{
	int e; while (cin >> e , e)
	{
		int m = 214214, x = 0;
		rep(z, 101) rep(y, 1001)
		{
			x = e - (y * y + z * z * z);
			if (e == x + (y * y) + (z * z * z) && x >= 0 ) 
			{ m = min(x + y + z, m); }
		}
		printf("%d\n", m);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int e;

    while (cin >> e, e) {
        int min_a = 1000000;
        int z_, y_;

        for (int z = 0; z * z * z <= e; z++)
            for (int y = 0; y * y + z * z * z <= e; y++) {
                if (min_a > z + y + e - y * y - z * z * z)  {
                    min_a = z + y + e - y * y - z * z * z;
                    z_ = z;
                    y_ = y;
                }
            }
        cout << e - y_ * y_ - z_ * z_ * z_ + y_ + z_ << endl;
    }

    return 0;
}

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

int main() {
  int e;
  while (cin >> e, e != 0) {
    int m = 1000000;
    for (int z = 0; z * z * z <= e; z++) {
      for (int y = 0; y * y <= e - z * z * z; y++) {
	for (int x = 0; x <= e - z * z * z - y * y; x++) {
	  if (x + y * y + z * z * z == e) {
	    m = min(m, x + y + z);
	    break;
	  }
	}
      }
    }

    cout << m << endl;
  }

  return 0;
}

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

using namespace std;

int main(void) {
	int e;
	while(1) {
		cin >> e;
		if(e == 0) {
			break;
		}
		
		int tmpx, tmpy, tmpz, tmpe;
		tmpe = e;
		tmpz = pow(e, 1.0 / 3.0);
		tmpe = tmpe - pow(tmpz, 3);
		if(tmpe == 0){
			tmpy = 0; tmpx = 0;
		}else{
			tmpy = pow(tmpe, 1.0 / 2.0);
			tmpe = tmpe - pow(tmpy, 2);
			if(tmpe == 0){
				tmpx = 0;
			}else{
				tmpx = tmpe;
			}
		}
		int tmpm = tmpx + tmpy + tmpz;

		int tmp, m = 100000;
		for(int z = 0; z <= tmpm; z++) {
			for(int y = 0; y <= min(tmpm - z, int(pow(e - pow(z, 3), 1.0 / 2.0))); y++) {
				int x = e - pow(y, 2) - pow(z, 3);
				tmp = x + y + z;
				if(tmp < m) {
					m = tmp;
				}
			}
		}

		cout << m << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<stdlib.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> pii;

int main()
{
  int e;

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

}

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

int main() {
  int e;
  while ( cin >> e && e ) {
    int answer = e;
    int l1 = (int)ceil(pow( e, 1.0/2.0 ));
    int l2 = (int)ceil(pow( e, 1.0/3.0 ));
    for ( int i = 0; i <= l1; i++ ) {
      for ( int j = 0; j <= l2; j++ ) {
	if ( i*i + j*j*j <= e ) {
	  int x = e - i * i - j * j * j;
	  int y = i;
	  int z = j;
	  answer = min( answer, x+y+z  );
	}
      }
    }
    cout << answer << endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#define INF 1<<21
using namespace std;

int main(){
  while (1){
    int n;
    cin >> n;
    if (n == 0) break;
    int res = INF;
    int i, j;
   
    for (i = 0;; i++){
      int tmp = n;
      tmp -= i*i*i;
      if (tmp<0) break;
      for (j = 0;; j++){
	if (j*j > tmp) break;
      }
      j--;
      tmp -= j*j;
      res = min(res, i+j+tmp);
    }

    cout << res << endl;
  }
  return 0;
}

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

int main(){
    long e;
    int x,y,z;
    cin>>e;
    long min=e;
    while(e!=0){
        min=e;
        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;
                if(x>=0){
                    if(min>x+y+z) min=x+y+z;
                }
            }
        }
        cout<<min<<"\n";
        cin>>e;
    }
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 30000;
    for (int z=0; z<=100; z++){
      if(z < m){
	for(int y=0; y<= sqrt(E-pow(z,3));y++){
	  if (y+z <m){
	    int x = E - pow(z,3) - pow(y,2);
	    if (x >= 0){
	      int n = x+y+z;
	      if(n < m){
		m = n;
	      }
	    }
	  }
	}
      }
    }
    cout << m << 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>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

ll solve(ll e){
    ll res = LINF;
    for(ll x = 0; x <= e; x++){
        for(ll y = 0; y*y <= e; y++){
            if(x + y*y > e) break;
            for(ll z = 0; z*z*z <= e; z++){
                if(x + y*y + z*z*z > e) break;
                if(x + y*y + z*z*z == e){
                    res = min(res,x+y+z);
                    break;
                }
            }
        }
    }
    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<cstdio>
#include<cmath>

using namespace std;

int INF = 10000000;

int cast(int e)
{
	
	

	 int Min = INF;

	 for(int i = 0;pow(i,3) <= e;i++)
	 {
		 for(int j = 0;pow(j,2) <= e-pow(i,3);j++)
		 {
			 int k = e - pow(i,3) - pow(j,2);
			 if(k >= 0)
			 {
				Min = min(i+j+k,Min);
			 }else
			 {
				 break;
			 }
		 }
	 }


	return Min;
}


int main()
{

  while(1)
  {
	 int e;

	 cin >> e;
 
	 if(!e)break;
	
	 cout << cast(e) << endl;

  }

  return 0;
}

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

#define PI 4*atan(1)
#define INF 1e8

int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};

int main(){
  int e;
  while(cin >> e, e){
    int m = INF;
    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;
        m = min(m, x + y + z);
      }
    }
    cout << m << endl;
  }
}