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;

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 <= tmpz; 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<vector>
#include<string>
#include<algorithm>
using namespace std;
int e;
int main() {
	
	vector<int> ans;
	while (cin >> e, e) {
		int m=1000000;
		for (int i = 0; i <= e; ++i) {
			if (i*i*i > e) break;
			for (int j = 0; j <= e; ++j) {
				if (i*i*i + j * j > e) break;
				if (e - i * i*i - j * j >= 0) m = min(m, i + j + e - i * i*i - j * j);
			}
		}
		ans.push_back(m);
	}
	for (int i = 0; i < ans.size(); ++i) {
		cout << ans[i] << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<stack>
#include<queue>
#include<sstream>
#include<string>
#include<bitset>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i);

using namespace std;

int main(){

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

		int ans=1<<28;

		rep(z,100){
			rep(y,1000){
				int x = e - ((z*z*z)+(y*y));
				if(x<0) continue;
				ans=min(ans,x+y+z);
			}
		}
	
		cout << ans << endl;
	}

	return 0;
}

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

int main(void){
  while(true){
    int e;
    cin >> e;
    if(e == 0){ break; }

    int ans = e;
    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);
        ans = min(ans, x + y + z);
      }
    }
    cout << ans << endl;
  }
  
  return 0;
}

C++: /*
  x + y^2 + z^3 = e テ」ツ?ォテ」ツ?甘」ツ??」ツ?ヲテ」ツ?』,y,zテ」ツ?ョテ」ツ??」ツ?。2テ」ツ?、テ」ツ?古・ツ按?」ツ?凝」ツつ古」ツ?ーテヲツョツ凝」ツつ甘」ツ?ョ1テ」ツ?、テ」ツつづヲツアツづ」ツ?セテ」ツつ凝」ツ??
  テ・ツ、ツ嘉ヲツ閉ーテ」ツ?ョテ・ツ?、テ」ツ?ョテ・ツ?凖ィツ」ツ愿」ツ?ョテヲツ閉ーテ」ツ?ッz,y,xテ」ツ?ョテゥツ??」ツ?ァテ・ツーツ妥」ツ?ェテ」ツ?敕」ツ??」ツ?ェテ」ツ?ョテ」ツ?ァz,yテ」ツ?ョテゥツ??」ツ?ァテ・ツ?ィテゥツ?堙」ツつ甘ィツゥツヲテ」ツ?凖」ツ??
 */

#include <stdio.h>
#define INF (1<<28)

int main() {
  int e, m, x, y, z, v;
  while(scanf("%d", &e) != EOF && e != 0) {
    m = INF;
    for(z = 0; z*z*z <= e; ++z) {
      for(y = 0; z*z*z + y*y <= e; ++y) {
        x = e - y*y - z*z*z;
        v = x + y + z;
        if(v < m) {
          m = v;
        }
      }
    }
    printf("%d\n", m);
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main() {
  ll e;

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

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 x=0;
    int y=0;
    int z=(int)cbrt(e*1.0);
    int ans=INF;
    for(;z>=0;z--){
      y=(int)sqrt((double)e-z*z*z);
      for(;y>=0;y--){
	x=e-z*z*z-y*y;
	ans=min(ans,x+y+z);
      }
    }
    cout<<ans<<endl;
  }

}

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

using namespace std;



int main(){

	int e;
	int x,y,z;
	int xm,ym,zm;
	int csum,msum=1000000;
	while(true){

		cin>>e;
		if(e==0) break;
		
		zm=pow(e,1.0/3);
		ym=sqrt(e-pow(zm,3));
		xm=e-pow(zm,3)-pow(ym,2);
		msum=xm+ym+zm;
		z=zm-1;
		y=sqrt(e-pow(z,3));
		x=e-pow(z,3)-pow(y,2);
		csum=x+y+z;
		if(csum<msum) msum=csum;
		cout<<msum<<endl;
	}	
	
	


return 0;
}

C++: #include<iostream>
#include<cmath>
main(){int e,x,y,z,m;for(;std::cin>>e,m=e;printf("%d\n",m))for(z=-1;++z*z*z<=e;x=e-y*y-z*z*z,m=m>x+y+z?x+y+z:m)y=pow(e-z*z*z,0.5);}

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

int main()
{
	while (true) {
		int e;
		cin >> e;

		if (e == 0) {
			break;
		}

		int ans = e;

		for (int x = 0; x <= e; x++) {
			for (int y = 0; y*y <= e; y++) {
				for (int z = 0; z*z*z <= e; z++) {
					if (x + y*y + z*z*z == e) {
						ans = min(x + y + z, ans);
						goto End;
					}
				}
			}
		}

		End:

		cout << ans << endl;
	}

	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<math.h>
using namespace std;
  
int main(){
	
	while(1){
		long int e,m,i,j,x,y,z;
		double a;
		cin>>e;
		if(e==0){break;}
		m=e;
		a=pow((double)e,1.0/3.0);
		for(i=pow((double)e,1.0/3.0);i>=0;i--){
			z=i;
			z+=0;
			for(j=sqrt((double)e-z*z*z);j>=0;j--){
				y=j;
				x=e-z*z*z-y*y;
				if(m>x+y+z){
					m=x+y+z;
				}
			}
		}
		cout<<m<<endl;
	}	
    return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int x,y,z;
int e;
int solve(){
	int minnum = 1000000;
	for(int z = 0; pow(z, 3) <= e; z++)
	{
		y = (int)sqrt(e - pow(z, 3));
		minnum = min(minnum,(int)(e - pow(z, 3)-pow(y, 2))+y+z); 
	}
	return minnum;
};
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>

using namespace std;
typedef long long int ll;

int main()
{
    ll e;
    while( cin >> e, e != 0 ) {
        ll mm = 99999999;

        ll z[101];
        ll zn = 0;
        for( ll i=0; i<=100; ++i ) {
            z[zn] = e - i*i*i;
            ++zn;
        }

        for( ll i=0; i<=100*100*100; ++i ) {
            for( ll j=0; j<zn ;++j ) {
                if ( z[j] - i*i < 0 )
                    break;
                
                ll const vy = i*i;
                ll const vz = -(z[j] - e);
                ll const vx = z[j] - vy;
                
                if ( vx + vy + vz != e )
                    break;
                
                if ( i + j + vx < mm ) {
                    mm = i + j + vx;
                }
            }
        }
        cout << mm << endl;
    }
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(void){
    int e;

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

        int m = 10000000;
        int M; //Mはx,y,zの和（全パターン)
        for(int z = 0; z*z*z <= e; z++){
            for(int y = 0; (e - (y * y) - (z * z * z)) >= 0 ; y++){
                M = e - (y * y) - (z * z * z) + y + z;
                if(M < m) m = M;
                 //cout << '@' << e - pow(y, 2) - pow(z, 3) << " " << y << " " << z << endl;
            }
        } 
        cout << m << endl;
    }
}