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 <math.h>
using namespace std;
int main() {
int e;
int x,y,z;
while(1){
int sum=0;
cin>>e;
if(e==0) break;
for (z=int(pow(e, 1.0 / 3.0));z>=0;z--){
  for (y=int(sqrt(e-z*z*z));y>=0;y--){
  x=e-y*y-z*z*z;
  if(sum>x+y+z||sum==0){
    sum=x+y+z;
  }
  }
}
cout<<sum<<endl;
}
return 0;
}

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

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

C++: #include "bits/stdc++.h"

#define REP(i,n) for(int i=0;i<n;++i)
#define RREP(i,n) for(int i=n-1;i>=0;--i)
#define FOR(i,m,n) for(int i=m;i<n;++i)
#define RFOR(i,m,n) for(int i=n-1;i>=m;--i)
#define ALL(v) v.begin(),v.end()
#define PB(a) push_back(a)
#define INF 1000000001
#define MOD 1000000007

const int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy[8] = { 0,1,1,1,0,-1,-1,-1 };

using namespace std;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	while (1) {
		int e, ans=INF;
		cin >> e;
		int c = e;
		if (!e) break;
		REP(i, 101) {
			REP(j, 1000) {
				if (pow(j, 2) + pow(i, 3) > e) break;
				REP(k, 2*j+1) {
					if (k + pow(j, 2) + pow(i, 3) > e) break;
					if (k + pow(j, 2) + pow(i, 3) == e) {
						ans = min(ans, i + j + k);
					}
					
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<math.h>
#include <limits.h>
using namespace std;
int count = 0;
int solve(int E)
{
  int ans =INT_MAX;
  for (int x=0; x<=E; ++x)
    for (int y=0; y*y<=E; ++y)
      {
	//cout<<"y="<<y<<endl;
	int z=(int)round(pow(E-x-y*y,1.0/3));
	//cout<<"z="<<z<<endl;
	if (x+y*y+z*z*z == E)
	{
	  if((x+y+z)<ans)
	  {
	    ans=x+y+z;
	    // cout<<ans<<endl;
	  }
	}
      }
  return ans;
}
int main()
{
  int E;
  while (cin >> E && E>0)
  {
    cout << solve(E) << endl;
  }
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int e,x,y,MIN,i,j;
int main(){
	while(true){
		MIN=1<<31;
		cin>>e;if(!e){break;}
		x=pow(e,0.5);
		y=pow(e,0.334);
		for(i=0;i<=y;i++){
			for(j=0;j<=x;j++){
				MIN=min(MIN,x+y+e-(i*i*i+j*j));
			}
		}
		cout<<MIN<<endl;
	}
}

C++: #include <stdio.h>
#include <iostream>
#include <queue>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#define PB push_back
#define in scanf
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
using	namespace std;
void solve(){
	int e;
	while(cin >> e ,e!=0) {
	int m =1000000000;
	int x;
	REP(z,(int)pow(e,0.333333)+3){
		REP(y,(int)pow(e,0.5)+3){
			x = e-pow(y,2)-pow(z,3);
			if(x>=0)m = min(x + y + z,m);
				
		}
	}
	cout << m  << endl;
	
}
}



	
int main(){
	solve();

}

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

int main(void){

  int e;

while(1){
    cin >> e;
    int ans = e;
    if(e == 0) break;
      for(int y=0; y <= sqrt(e); y++){
	for(int z=0;z <= pow(e,1.0/3.0); z++){
	int x = e - y*y - z * z * z;
	  if(e == x + y*y + z*z*z && x >= 0){
	    ans = min(ans,x+y+z);
	    //cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }

    cout << ans << endl;

 }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int e;
	int m;
	while( 1 ){
		m = 1000000;
		cin >> e;
		if( e == 0 ) break;
		for( int z = 0; z*z*z <= e ; z++ ){
			for( int y = 0; y*y + z*z*z <= e ; y++ ){
				if( m > y + z + e - y*y - z*z*z){
					m = y + z + e - y*y - z*z*z;
				}
			}
		}
		cout << m << endl;
	}
}

C++: #include <iostream>
#include <cmath>
#include <cassert>
typedef long long ll;
using namespace std;
template <typename T> T sq(T x) { return x * x; }
template <typename T> T cb(T x) { return x * x * x; }
int main() {
    while (true) {
        int e; cin >> e;
        if (not e) break;
        ll m = e;
        ll z = 0;
        while (cb(z + 1) <= e) ++ z;
        for (; z >= 0; -- z) {
            ll y = 0;
            while (sq(y + 1) + cb(z) <= e) ++ y;
            assert (sq(y) + cb(z) <= e and e < sq(y + 1) + cb(z));
            ll x = e - sq(y) - cb(z);
            m = min(m, x + y + z);
        }
        cout << m << endl;
    }
    return 0;
}

C++: // Space Coconut Crab
#include <iostream>
#include <math.h>
using namespace std;
int count = 0; // ?¨???¬??¨ global ?????°
int solve(int E) {
  count = 0;
  // x+y*y+z*z*z=E
  int ans = E; // ?????§??? 
  // 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;
  //       ++count;
  //       if (x+y+z < ans) // x+y+z??????????°??????????ans?????´??°
  //           ans = x+y+z;
  //   }
  for (int x=0; x<=E; ++x)
    for (int y=0; y*y<=E-x; ++y){
        double zd = pow(E - x - y*y,1.0/3.0);
        int z = round(zd);
        ++count;
        if (x+y*y+z*z*z == E)
          if (x+y+z < ans) // x+y+z??????????°??????????ans?????´??°
            ans = x+y+z;
    }
  return ans;
}
int main() {
  int E;
  while (cin >> E && E>0) {
    cout << solve(E) << endl; 
    // cout << count << endl; 
  }
}
// ?????´?????????????????¨?????????????????????????????? 10^11???...8?§???\?????????
// for????????????????????????????????????????????????????????????????????£???

C++: #include <stdio.h>
#include <algorithm>

using namespace std;

int e;

int main()
{
	while (true)
	{
		scanf("%d", &e);

		if (e == 0) break;

		int ret = 999999999;

		for (int y = 0; y * y <= e; y++)
		{
			for (int z = 0; y * y + z * z * z <= e; z++)
			{
				int x = e - (y * y + z * z * z);

				ret = min(ret, x + y + z);
			}
		}

		printf("%d\n", ret);
	}
}

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

int main() {
	int e, ans;
	while ( cin >> e && e != 0 ) {
		ans = 1000000;
		for ( int z = 0; z * z * z <= e; z++ ) {
			for ( int y = 0; z * z * z + y * y <= e; y++ ) {
				for ( int x = 0; z * z * z + y * y + x <= e; x++ ) {
					if ( z * z * z + y * y + x == e && x + y + z < ans ) ans = x + y + z;
				}
			}
		}
	cout << ans << endl;
	}
}