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>


using namespace std;

bool check(int a, int b, int c, int n){
  if (a + b*b + c*c*c == n)
  {
    return true;
  }
  return false;
}

int solve(int n){
  int a, b, c;
  a = 0;
  b = 0;
  c = 0;
  if(check(a, b, c, n))
  {
    return a+b+c;
  }
  for (int i = 0; i < 1000000; ++i)
  {
    if(check(a, b, c+1, n))
    {
      return a+b+c;
    }
    if(check(a, b+1, c, n))
    {
      return a+b+c;
    }
    if(check(a+1, b, c, n))
    {
      return a+b+c;
    }
    if(check(a, b+1, c+1, n))
    {
      return a+b+c;
    }
    if(check(a+1, b, c+1, n))
    {
      return a+b+c;
    }
    if(check(a+1, b+1, c, n))
    {
      return a+b+c;
    }
    if(check(++a, ++b, ++c, n))
    {
      return a+b+c;
    }
  }
}


int main(){
  int n;
  while(true){
    cin >> n;
    if (n == 0)
    {
      break;
    }
    cout << solve(n) << endl;
  }
}

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

using namespace std;

int main() {
  int e;
  while ((cin >> e) && e != 0) {
    int m = e;
    for (int z=0; z<=100; z++) {
      int zzz = z*z*z;
      if (zzz > e) break;
      for (int y=0; y<=100000; y++) {
        int yy = y*y;
        if (yy+zzz > e) break;
        int x = e - (yy+zzz);
        m = min(m, x+y+z);
      }
    }
    cout << m << endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
#define MAX	1000000
int main()
{
	int e;
	for (; cin >> e, e != 0;)
	{
		int m_min = MAX , y, z;
		for (y = 0; y <= 1000; y++)
		{
			for (z = 0; z <= 100; z++)
			{
				int x;
				x = e - y*y - z*z*z;
				if (x < 0)continue;
				if (m_min > x+y+z)m_min = x+y+z;
			}
		}
		cout << m_min << endl;
	}
	return 0;
}

C++: #include<stdio.h>
using namespace std;

int main(){
	long long sum , E;
	int y, z;
	while (scanf_s("%lld", &E), E){
		sum = 1000000;
		for (z = 0; z*z*z <= E; z++)
			for (y = 0; y*y <= E; y++){
				long long x = E - z*z*z - y*y;
				if (x<0){ break; }
				else if (sum>(x + y + z))sum = x + y + z;
			}
		printf("%lld\n", sum);
	}

	return 0;
}

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

int mycount = 0; // ambigous??¨???????????????????????????
int solve(int E) {
 // ?????´????±???????
	int ans = 1000000; // ?????§???
	for (int z=0; z*z*z<=E; ++z)
		for (int y=0; y*y<=E; ++y){
			int x = E-z*z*z-y*y;
				++mycount; 
				if (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)
		solve(E);
}

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

int main(void){

  int e;

while(1){
    int ans = 1000000000;
    cin >> e;
    
    if(e == 0) break;
    for(int x=0; x <= 117; x++){
      for(int y=0; y <= 172; y++){
	for(int z=0;z <= 99; z++){
	  if(e == x + y*y + z*z*z){
	    ans = min(ans,x+y+z);
	    //cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }
    }

    cout << ans << 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,1000){
            rep(j,0,1000){
                int k=e-i*i-j*j*j;
                if(k<0)continue;
                ans=min(ans,i+j+k);
            }
        }
        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,msum=1000000;
	while(true){

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

	}	
	
	


return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
  int s, t, u, e, m;

  while(cin>>e && e){
    bool f = true;
    for(int i = 0; i < 100000 && f; i++){
      for(int j = 0; j*j <= 1000000 && f; j++){
	for(int k = 0; k*k*k <= 1000000 && f; k++){
	  s = i+j*j+k*k*k;
	  if(s == e){
	    cout << (i+j+k) << endl;
	    f = false;
	  } else if(s > e){
	    break;
	  }
	}
      }
    }
  }

  return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int e;
int m, a;
int main()
{
	while(cin >> e && e!=0)
	{
		m=e;
		for(int z=0; (z*z)*z<=e; z++)
		{
			for(int y=0; (y*y)+((z*z)*z)<=e; y++)
			{
				a=y;
			}
			m=min(m, a+z+e-a*a-z*z*z);
		}
		cout << m << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int e;
	while ( cin >> e, e ) {
		int ans = e;
		for (int z = 0; z*z*z <= e; ++z) {
			for (int y = 0; z*z*z + y*y <= e; ++y) {
				int x = e - (y*y + z*z*z);
				ans = min(ans, x+y+z);
			}
		}
//		int x = 0, y = 0, z = 0;
//		if (e >= 8) { for (z = 2; z*z*z <= e; ++z); --z, e -= z*z*z; }
//		if (e >= 4) { for (y = 2; y*y <= e; ++y); --y, e -= y*y; }
//		x = e;
		cout << ans << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define all(a) a.begin(),a.end()
#define rep(i,n) for(int i=0;i<n;i++)
int main(void){
    int n;
    while(cin>>n,n){
        int ans=10000000;
        for(int z=0, zlim=(int)floor(pow(n,1./3));z<=zlim;z++){
            for(int y=0, ylim=(int)floor(sqrt(n-z*z*z)) ; y<=ylim;y++){
                ans=min(ans, n-z*z*z-y*y+y+z);
            }
        }
        cout<<ans<<endl;
    }
}

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

using namespace std;

int main() {
  int e;
  while (cin >> e) {
    if (!e) { break; }
    int ans = e;
    for (int z = 0; z <= 101; z++) {
      for (int y = 0; y <= 1001; y++) {
        int x = e - y*y - z*z*z;
        if (0 <= x && x <= 100000) {
          ans = min(ans, x+y+z);
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

int main() {
	int e;
	while (cin >> e&&e) {
		int minl = INF;
		for (int i = 0; i*i*i <= e; i++) {
			for (int j = 0; j*j <= e - i*i*i; j++) {
				minl = min(minl, i + j + e - i*i*i - j*j);
			}
		}
		cout << minl << endl;
	}
}