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>
using namespace std;

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,n) for(int i=(int)(n-1);i>=0;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define print(x) cout << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;
typedef pair<int, P> PIP;
typedef pair<ll, ll> PL;
typedef pair<P, ll> PPL;
typedef set<int> S;

#define INF INT_MAX/3
#define MAX_N 1000000001


int main(){
  cin.sync_with_stdio(false);
  int e;
  while(cin >> e, e) {
    int mini = INF;
    int z = pow(e, 1.0 / 3.0);
    rep(i, z + 1) {
      int tmp = e - i * i * i;
      int y = sqrt(tmp);
      rep(j, y + 1) minch(mini, i + j + (tmp - j * j));
    }
    cout << mini << endl;
  }

  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>

#define REP(i,n) for(i=0; i < (n); i++)
#define REPONE(i, n) for(i=1; i <= (n); i++)
#define LOOP(n) for(int loopCount=1; loopCount <= (n); loopCount++)
#define ITER(c) __typeof((c).begin())
#define EACH(c,it) for(ITER(c) it =(c).begin(); it!=(c).end(); it++)
#define SZ(c) ((int) (c).size())
#define ALL(c) c.begin(), c.end()
#define SUM(c) accumulate(ALL(c), 0)
#define EXIST(c,v) (find(ALL(c), (v)) != (c).end())
#define PB push_back
#define MP make_pair

using namespace std;
static const double EPS = 1e-9;
static const double PI = 3.141592653589793238462643383279;
typedef long long ll;

int main(){
    int m, y, z, e;

    while(scanf("%d",&e)){
        if(!e) break;
        m = 1<<30;
        for(z=0;z*z*z <= e; z++)
            for(y=0; y*y+z*z*z <= e; y++)
                m = min(e-y*y-z*z*z+y+z, m);
        printf("%d\n",m);
    }

    return 0;
}

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

int E;

void solve(){
    while(cin >> E && E > 0){
        int x,y,z;
        int X,Y,Z;
        int min = 100000;
        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 (min > x + y + z){
                    min = x + y + z;
                }
            }
        }
        cout << min << endl;
    }
}

int main(){
    solve();
}

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

using namespace std;

int main(){
  int e;

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

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
 
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int hoge(int e){
  int num;
  REP(a,e+1){
	REP(b,1001){
	  REP(c,101){
		num = a + b*b + c*c*c;
		//		cout << num << endl;
		if(num > e) break;
		if(num == e) return (a + b + c);
		
	  }
	}
  }  
	return -1;
}

int main(){

  int e;

  while(1){
	cin >> e;
	if(e==0) break;

	cout << hoge(e) <<endl;

  }
}

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

int main(){
int e,x,y,z,min;

while(1){
cin >> e;
if(e == 0)break;
min = e;
for(z=0;z*z*z<=e;z++){
y=(int)sqrt((double)(e-z*z*z));
x = e-z*z*z-y*y;

min = (min > x+y+z)?x+y+z:min;
}

cout << min << endl;
}
return 0;
}

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

const int MAX_INT = 2147483647;

using namespace std;
int main(){
    int x,e,m,ypi,zpi;
    while(true){
        cin >> e;
        if(e==0) break;
        int minM=MAX_INT;
        for(int zi=0;zi<=100;zi++){
            zpi=zi*zi*zi;
            if (e-zpi<0) break;
            for(int yi=0;yi<=1000;yi++){
                ypi=yi*yi;
                if(e-ypi-zpi<0) break;
                x=e-ypi-zpi;
                m=x+yi+zi;
                minM=min(minM,m);
            }
        }
        cout << minM << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char const *argv[])
{
	int x,y,z;
	int e;
	int min;

	while(1){
		cin>>e;
		if(e==0) break;

		min=e;
		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;

				if(min>(x+y+z)) min=x+y+z;
			}
		}
		cout<<min<<endl;
	}
	return 0;
}

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

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

C++: #include<iostream>
#include<cmath>
using namespace std;
int solve(int E)
{
    int ans=3000000;
    int x;
    for(int y=0;y<=1000;++y)
        for(int z=0;z<=100;++z)
        {
            x=E-y*y-z*z*z;
            if((x+y+z<ans)&&(x>0))
                ans=x+y+z;
        }
    return ans;
}
int main()
{
    int E;
    while(cin>>E&&E>0)
        cout<<solve(E)<<endl;
    return 0;
}

C++:     #include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<cmath>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>
    #include<cassert>
    #include<cmath>
    #include<cstdint>
using namespace std;

#define ALL(a) (a).begin(), (a).end()
#define INF 1e9
using ll = long long;

int main(){
    ll e;
    while(cin >> e){
        if(e == 0)break;
        ll res = INF * INF;
        for(int z = 0; z <= 100; z++){
            for(int y = 0; y <= 1000; y++){
                ll x = e - (y * y) - (z * z * z);
                if(x < 0)continue;
                res = min(res, x + y + z);
            }
        }
        cout << res << endl;
    }
}