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<cmath>
#include<algorithm>
#include<cstring>
using namespace std;

int Bsearch(int e,int n){
  //cout << n << endl;
  int l=0,r=e;
  int i=(l+r)/2;
  while(r-l>=1){
    i=(l+r)/2;
    //cout << "i:" << i << endl;
    if(e == pow(i,n)){
      //cout << "aaa:" << i << endl;
      return i;
    }else if(e > pow(i,n)){
      l=i+1;
    }else{
      r=i;
    }
  }
  //cout << "i:" << i << endl;
  return i;
}

int a[2000][2000];

int main(){
  int x,y,z,e;
  while(cin>>e,e){
    memset(a,0,sizeof(a));
    y=Bsearch(e,2);
    z=Bsearch(e,3);

    int m=1000000;
    //cout << "z:" << z << " y:" << y << endl;
    for(int i=0;i<=1000;i++){
      for(int j=0;j<=100;j++){
	x=e-i*i-j*j*j;
	if(x>=0)m = min(x+i+j,m);
      }
    }
    cout <<m << endl; 
  }
}

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

#define FOR(i,l,n) for(int (i)=(l);(i)<(n);(i)++)
#define REP(i,n) FOR(i,0,n)

#define MAX_Y 1000
#define MAX_Z 100
using namespace std;

int main(){
    long int x,y,z,e,m=1000000;
    while(cin>>e,e){
        FOR(y,1,(int)pow(e,1/2)){
            FOR(z,1,(int)pow(e,1/3)){
                x = e-pow(z,3)-pow(y,2);
                if(x>=0&&x+y+z<m)m=x+y+z;
            }
        }
        cout<<m<<endl;
    }
    return 0;
}

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

int main(){
while(1){//start
	
	int e;
	int ans = 100000000;
	cin >> e;
	
	if(e == 0)break;
	
	for(int x = 0; x < 1000000; x++){
		for(int y = 0; y < 1000; y++){
			if(x + y*y > e) break;
			for(int z = 0; z < 100; z++){
				if(x + y*y + z*z*z > e) break;
				else if(x + y*y + z*z*z == e){
					ans = min(ans, x + y + z);
				}
			}
		}
	}
	
	cout << ans << endl;
	
}//ebd	
	return 0;
}

C++: #include <iostream>

using namespace std;

const int INF = 1145148100;

int main(void)
{
    int e;
    while(cin >> e and e) {
        int ans = INF;
        for(int y = 0; y*y <= e; y++) 
            for(int z = 0; z*z*z <= e; z++)
                ans = min(ans, e - y*y - z*z*z + y + z);

        cout << ans << endl;
    }

    return 0;
}

C++: //
//  main.cpp
//  Exercise
//
//

#include <algorithm>
#include <iostream>
#include <limits>
#include <math.h>
#include <tuple>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "string.h"
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <set>

using namespace std;

using int_t = long long;

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2012

int main() {
    vector<int> es;
    while (true) {
        int e;
        scanf("%d", &e);
        es.push_back(e);
        if (e == 0) {
            break;
        }
    }
    for (auto e : es) {
        int sumMin = numeric_limits<int>::max();
        for (int y = 0; y * y <= e; y++) {
            for (int z = 0; z * z * z <= e - y * y; z++) {
                int x = e - y * y - z * z * z;
                sumMin = min(sumMin, x + y + z);
            }
        }
        printf("%d\n", sumMin);
    }
    return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline long toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline long toLong(string s) {long v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const int INF = 10000;

struct edge{
	int l,r,h;
	bool operator<( const edge& right ) const {
        return h == right.h ? r < right.r : h < right.h;
    }
};


int main(){
	long e;
	while(cin>>e){
		if(e==0)break;
		long sum=10000000;
		for(long i=0;i*i*i<=e;i++){
			for(long j=0;i*i*i+j*j<=e;j++){
				sum=min(sum,i+j+(e-i*i*i-j*j));
			}
		}
		cout<<sum<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#define rep(i,l,n) for(lint i=l;i<n;i++)
#define rer(i,l,n) for(lint i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef vector<lint> vli;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	int e;
	while(1){
		cin>>e;
		if(e==0) break;
		int m=10000000;
		for(int i=0;i*i*i<=e;i++){
			for(int j=0;j*j<=e-i*i*i;j++){
				m=min(m,e-i*i*i-j*j+i+j);
			}
		}
		o(m);
	}
}

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

int main(){
  int E;
  cin >> E;
  int min=E;
  for(int z=0;z<=100;z++){
    for(int y=0:y*y<E-z*z*z;y++){
      sum=(E-y*y-z*z*z)+y+z;
      if(min>sum) min=sum;
    }
  }
  cout << min <<endl;
  return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const int INF = 1 << 20;
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

C++: #include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

vector<int> ans;

int main(){
	while(1){
		int e;
		cin >> e;
		if(e == 0) break;
		int m = 1e9;
		for(int i = 0;i < e;i++){
			if(i*i*i > e) break;
			int iii = i*i*i;
			for(int j = 0;j < e - iii;j++){
				if(j*j > e - iii) break;
				int jj = j*j;
				int k = e - jj - iii;
				m = min(m,i+j+k);
			}
		}
		ans.push_back(m);
	}
	for(int i = 0;i < ans.size();i++)cout << ans[i] << endl;
	
	return 0;
}