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 <cstdio>
#include <cmath>

using namespace std;

int main() {

  int e,x,y,z;

  for(;;){
    cin >> e;
    if(!e)break;
    int xm = e+1;
    int ym = (int)sqrt(e)+1;
    int zm = (int)cbrt(e)+1;

    int f,g1,g2,g3,m=3*e;
    for(int i=zm;0<i;--i){
      g1=i*i*i;
      if(g1<e)
	for(int j=0;j<ym;++j){
	  g2=i*i*i+j*j;
	  if(g2<e){
	    int k=e-i*i*i-j*j;
	    f=i+j+k;
	    if(f<m)m=f;
	  }
	}
    }
    
    cout << m << endl;
  }
  
}

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

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int ans=INF;
    for(int i=0;i*i*i<=n;i++){
      for(int j=0;j*j<=(n-i*i*i);j++){
	ans=min(ans,n+i+j-(i*i*i+j*j));
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

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

using namespace std;



int main(){

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

		cin>>e;
		if(e==0) break;
		
		zm=pow(e,1.0/3);
		for (int i = zm; i >= zm-10; --i)
		{
			
			ym=sqrt(e-pow(i,3));
			for (int j =ym ; j >=0; --j)
			{
				x=e-pow(i,3)-pow(j,2);
				csum=x+j+i;
				if(csum<msum) msum=csum;
			}
		}
		cout<<msum<<endl;
	}	
	
	


return 0;
}

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

int main(){
	int n;
	cin >> n;
	while(n != 0){
		int a;
		a = 1e9;
		for(int i = 0; i*i*i <= n; i++){
			for(int j = 0; j*j+i*i*i <= n; j++){
				int t =(n-i*i*i-j*j);
				if(t >= 0)a= min( i+j+t, a);
			}
		}
		cout << a<<endl;
		cin >> n;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
  int e, m;
  while (cin >> e, e) {
    m = e;
    for (int i = 0; i*i <= e; ++i) {
      for (int j = 0; j*j*j + i*i <= e; ++j) {
	m = min(m, e + i + j - i*i - j*j*j);
      }
    }
    cout << m << endl;
  }
  return 0;
}

C++: #include <iostream>
#define REP(i, a, n) for(int i = (a); i < (n); i++)
using namespace std;

int E;

int main(void) {
  while(cin >> E, E) {
    int ans = 100000000;
    REP(z, 0, 101) {
      int z3 = z * z * z;
      if(z3 > E) break;
      REP(y, 0, 1001) {
        int y2 = y * y;
        int x = E - z3 - y2;
        if(x < 0) continue;
        ans = min(ans, x + y + z);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
void k(int,int);
int m;
int main(){
  int e,i,j,k;
  while(1){
    m=10000000;
    cin >> e;
    if(e==0) break;
    for(i=0;i<=100;i++){
      for(j=0;j<=1000;j++){
	k=e-j*j-i*i*i;
        if(k>=0&&j>=0&&i>=0&&m>i+j+k){
	  m=i+j+k;
	}
      }
    }
    cout << m << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(x) for(auto it=(x).begin();it!=(x).end();it++) 
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

int main(){
    while(1){
        int e;
        int ans=1e9+7;
        cin>>e;
        if(e==0)break;
        
        rep(i,0,e+1){
            rep(j,0,e+1){
                rep(k,0,e+1){
                    if(i+j*j+k*k*k==e)ans=min(ans,i+j+k);
                }
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

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

int mycount = 0; // ambigous??¨???????????????????????????
int solve(int E) {
 // ?????´????±???????
	int ans = 1000000; // ?????§???
	for (int x=0; x<=E; ++x)
		for (int z=0; z*z*z<=E; ++z){
			int y = (int)round(pow(E-x-z*z*z,1.0/2));
				++mycount; 
				if (y>=0 && x+y*y+z*z*z == E)
					if (x+y+z<=ans)
						ans = x+y+z;
			}
	return ans;
}
int main() {
	int E;
		while(cin >> E && E>0)
		cout << solve(E) << endl;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)
#define RREP(i, a, n) for(int i=n-1; i>=a; i--)
#define INF 1000000000

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

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

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

int main(){
  int E;
  cin >> E;
  int min=E;
  int sum;
  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;
    }
  }
  return min;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
    int e;
    cin >>e;

    while(e)
    {
        int x=0;
        int y=0;
        int z=0;
        int m=0;
        for(x = 0;x<=e;x++)
            for(y=0;y<=e/2;y++)
                for(z = 0;z<=e/9;z++)
        {
            if(e==x+y*y+z*z*z)
            {
                int t = x+y+z;
                if(m ==0||m>t)
                    m=t;
            }
        }
        cout <<m<<endl;




        cin >>e;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
void solve(int n){
    vector<int> y,z;
    y.push_back(0);
    z.push_back(0);
    for(int i=1;i<1000;i++){
        y.push_back(i*i);
        z.push_back(i*i*i);
    }
    int ans=0;
    for(int i=0;1;i++){
        for(int j=0;pow(max((j-1),0),2)+i<n;j++){
            ans=0;
            for(int k=0;ans<=n;k++){
                ans=i+y[j]+z[k];
                //cout<<ans<<"!"<<endl;
                if(ans==n){
                    cout<<(i+j+k)<<endl;
                    return;
                }
            }
        }
    }
}

int main(void){
    int n;
    while(cin>>n,n){
        solve(n);
    }
    
}

C++: #include <iostream>
#include <cmath>
using namespace std;
 
typedef long long ll;
 
ll e, m, x, min_;
 
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    while (cin >> e, e) {
        min_ = m = (int)(1e9 + 7);
 
        for (int y = 0; y <= sqrt((double)e); y++) {
            for (int z = 0; z <= cbrt((double)e) + 1; z++) {
                x = e - y * y - z * z * z;
                if (x < 0) break;
                else {
                    m = x + y + z;
                    //cout << "x, m = " << x << " " << m << endl;
                    if (min_ > m) min_ = m;
                }
            }
        }
 
        cout << min_ << endl;
    }
 
    return 0;
}

C++: #include <stdio.h>
int main(void)
{
  int e,m;
  int i,j,k;
  for(;;)
    {
      scanf("%d",&e);
      m=e+1;
      if(e==0){break;}
      for(i=0;i<=e;i++)
	{
	  /*printf("i=%d",i);*/
	  for(j=0;j<=e-i;j++)
	    {
	      for(k=0;k<=e-j-i;k++)
		{
		  /*printf("%d",k);*/
		  if(i+(j*j)+(k*k*k)==e && i+j+k<m)
		    {
		      m=i+j+k;
		      /*printf("m1=%d\n",m);*/
		    }
		}
	    }
	}
      printf("%d\n",m);
    }
  return 0;
}