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 <cstdio>

int main(void)
{
    int e;
    int x, y, z, xyz;
    while(scanf("%d", &e), e != 0){
        for(xyz = 1; xyz <= e; xyz++){
            for(z = 0; z * z * z <= xyz; z++){
                for(y = 0; y * y <= xyz; y++){
                    x = xyz - z - y;
                    if(x + y * y + z * z * z > e){
                        break;
                    }else if(x + y * y + z * z * z == e){
                        printf("%d\n", xyz);
                        x = xyz;
                        xyz = e;
                        break;
                    }
                }
            }
        }
    }
    return 0;
}

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

int main() {
    while (true) {
        int e;
        cin >> e;
        if (e == 0) {
            break;
        }
        int result = 1 << 30;
        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 < result) {
                    result = x + y + z;
                }
            }
        }
        cout << result << endl;
    }
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	int n;
	cin>>n;
	int mi=inf;
	rep(i,110)rep(j,1010){
		int k=n-i*i*i-j*j;
		if(k<0)continue;
		mi=min(mi,i+j+k);
	}
	cout<<mi<<endl;
}






ZS

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

int getBarrier(int m){
  int a,b,c,mini=10000000;
  if(fabs( cbrt(m) - (int)(cbrt(m)) )<0.000001){
    a=cbrt(m);
    b=cbrt(m);
    c=cbrt(m);
  }
  else if(fabs( sqrt(m) - (int)(sqrt(m)) )<0.000001){
    a=sqrt(m);
    b=sqrt(m);
    c=sqrt(m);
  }
  else{ 
    a=cbrt(m);
    b=sqrt(m);
    c=m;
  }
  // cout<<a<<b<<c<<endl;
  for(int i=a;i>=0;i--)
    for(int j=b;j>=0;j--)
      for(int l=c;l>=0;l--){
	if(i*i*i+j*j+l == m){
	  mini=min(mini,i+j+l);
	}
      }
  cout<<mini<<endl;
  return 0;
}

int main(){

  int m;
  while(1){
    cin>>m;
    if(m==0) break;
    getBarrier(m);
  }
  return 0;
}

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

int main() {
  int e;
  while (cin >> e, e != 0) {
    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) {
	    cout << x + y + z << endl;
	    goto END;
	  }
	}
      }
    }
  END:
    e;
  }

  return 0;
}

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



int main(){
    int E,y,z;
    while (cin >> E && E!=0) {
        int minimum=1000000;
        for (z=0; z*z*z<=E; z++) {
            for (y=0; y*y<=E-z*z*z; y++) {
                minimum=min(minimum,E+y+z-(y*y+z*z*z));
            }
        }
        cout << minimum << endl;
    }
}

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

using namespace std;

int rt(int pow, int n) {
    int min = 0;
    int max = 1000;
    while (min < max) {
        int mid = (min + max + 1) / 2;
        int val = mid;
        for (int i = 1; i < pow; ++i) {
            val *= mid;
        }
        if (val > n) {
            max = mid - 1;
        } else {
            min = mid;
        }
    }
    return max;
}

int main() {
    //cout << rt(2, 4) << endl;
    //cout << rt(3, 7) << endl;
    
    
    while (1) {
        int e;
        cin >> e;

        if(e == 0) break;

        int m = 10000000;
        int zmax = rt(3, e);
        for (int z = 0; z <= zmax; ++z) {
            int y = rt(2, e - z * z * z);
            int x = e - z * z * z - y * y;
            if (m > x + y + z) m = x + y + z;
        }
        cout << m << endl;
        
    }
}

C++: #include<iostream>
#include<climits>
#include<cmath>

using namespace std;

int main(){
	int e,m;
	
	while(cin>>e,e){
		m=INT_MAX;
		for(int z=0;z<=100;z++){
			int xy2=e-pow((double)z,3.0);
			if(xy2<0){
				break;
			}
			for(int y=0;pow((double)y,2.0)<=xy2;y++){
				int x=xy2-pow((double)y,2.0);
				m=min(m,x+y+z);
			}
		}
		cout<<m<<endl;
	}
}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int e;

    while(cin>>e,e){
        int res=10000000;
        for(int z=100;z>=0;z--){
                for(int y=1000;y>=0;y--){
                    int x=e-z*z*z-y*y;

                    if(x>=0){
                        res=min(res,x+y+z);
                    }
                }
        }

        cout << res << endl;
    }
}

C++: #include<stdio.h>
#include<math.h>
int main(){


int E;
while(1){
scanf("%d",&E);if(E==0)break;
int min=E;int m=E,max=0;
int i=1;int y=0,z=0;
for(int j=0;j<=sqrt((double)(E));j++){
for(int k=0;k<=pow((double)(E-j*j),1.0/3.0);k++)
{i=E-j*j-k*k*k;//printf("%d %d %d\n",i,j,k*k*k);
	if(i+j*j+k*k*k>E)break;
	if(i>=0&&i+j*j+k*k*k==E&&i+j+k<min){min=i+j+k;max=j*j+k*k*k;y=j;z=k;}
}}
i=E-y*y-z*z*z;
m=i+y+z;
printf("%d\n",min);
}
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 <= 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<bits/stdc++.h>
using namespace std;
int main(){
  int e,min;
  while(cin >> e && e){
    if(e == 1)cout << 1 << endl;
    else{
      min = 1000001;
      for(int i=0;i<=e;i++){
	for(int j=0;j<=e-i;j++){
	  for(int k=0;k<=e-j*j-i;k++){
	    if(i+j*j+k*k*k == e){
	      if(min > i + j + k)min = i+j+k; 
	    }
	  }
	}
      }
      cout << min << endl;
    }
  }
}

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

int main(){
	int e,minn;
	while(1){
		cin>>e;
		if(e==0) break;
		minn=200000000;
		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);
				minn=min(minn,x+y+z);
			}
		}
		cout<<minn<<endl;
	}
	return 0;
}