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(){
	int n;
	cin >> n;
	while(n != 0){
		int a;
		a = 1e9;
		for(int i = 0; i < pow(n,0.34); i++){
			for(int j = 0; j <= pow(n,0.5); 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 <bits/stdc++.h>
using namespace std;

int main(void){
  int e;
  while(cin >> e, e){
    int x, y, z;
    int ans = INT_MAX;
    for(z = 0; z <= pow(e, 1.0/3.0); z++){
      for(y = 0; y <= sqrt(e); y++){
        if(pow(z, 3) + pow(y, 2) > e) break;
        ans = min(ans, (int)(z + y + (e - pow(y, 2) - pow(z, 3))));
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

int main(){
	int e;
	while(cin >> e , e){
		int m=1e+9;
		for(int z=0 ,z1=0;z<=e;++z1 , z=pow(z1,3.)){
			for(int y=0 , y1=0;y<=e; ++y1 , y=pow(y1,2.)){
				int x=e-(y+z);
				if(x>=0) m= min(m , x+(int)sqrt(y)+(int)cbrt(z));
			}
		}
		cout << m << endl;
	}
	return 0;
}

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.333)+1){
		REP(y,(int)pow(e,0.5)+1){
			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 <math.h>
#include <iostream>
using namespace std;
int main() {
  int ene;
  while( cin >> ene && ene>0){
    int min = 1000000;
    for( int z=0; z<=100; z++) {
      int xy = ene - z*z*z;
      if( xy >= 0)
	for( int y=0; y<=xy; y++) {
	  int x = xy - y*y;
	  if( x>=0)
	    if( x+y+z<min) min = x+y+z;
	}
    }
    cout << min << endl;
  }
}

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

using namespace std;

int main(){
  for(int e;cin>>e,e;){
    int m=1<<30;
    for(int z=0;z*z*z<=e;z++){
      for(int y=0;z*z*z+y*y<=e;y++){
	m=min(m,e-z*z*z-y*y+y+z);
      }
    }
    cout<<m<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int e,ans;
	while(cin>>e,e){
		ans=e;
		int x;
		double d=sqrt(e)+1,g=pow(e,(double)1/3)+1;
		rep(y,d){
			rep(z,g){
				x=e-y*y-z*z*z;
				if(x<0)continue;
				ans=min(ans,x+y+z);
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

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

void solve(int a){
	int m = 1e9;
	for(int i=0; i*i*i<=a; ++i)
		for(int j=0; i*i*i+j*j<=a; ++j)
			m = min(m, i + j + a - i*i*i - j*j);
	cout << m << "\n";
}

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	while(1){
		int a;
		cin >> a;
		if(a == 0) return 0;
		solve(a);
	}
}

C++: #include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const int INF = 1001001001;

int e, x, y, z, m;
int main()
{

	while (1)
	{
		cin >> e;
		if (e == 0) break;
		m = INF;
		rep(z, 101)
		{
			rep(y,1001)
			{
				x = e - y*y - z*z*z;
				if (x >= 0)
				{
					m = min(m, x + y + z);
				}
			}
		}
		cout << m << endl;

	}
	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 100000000
using namespace std;
int main(){
  int e;
  while(1){
    cin >> e;
    if(e==0) break;
    int ans = INF;
    for(int y=0; y<1000; y++){
      for(int z=0; z<1000; z++){
	int x = e-y*y-z*z*z;
	if(x<0) continue;
	ans = min(ans,x+y+z);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int solve(int E){
    int ans=E;
    for (int z=0;z*z*z<=E;++z){
        for (int y=0;y*y<=E;++y){
            int x=E-y*y-z*z*z;
            if(x+y+z<ans&&x>=0)
                ans=x+y+z;
             }
    }
    return ans;
}
int main(){
    int E;
    while (cin>>E&&E>0){
        cout<<solve(E)<<endl;
    }
}

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

inline bool isint(double x){
	int a=(int)x;
	if(a==x) return true;
	return false;
}

int main(){
	int e;
	while(cin >> e , e){
		int m=1e+9;
		for(int x=0;x<=e;++x){
			for(int y=0 , y1=0;y<=e; ++y1 , y=pow(y1,2.)){
				int z=e-(x+y);
				if(z>=0 && isint(cbrt(z))) m= min(m , x+(int)sqrt(y)+(int)cbrt(z));
			}
		}
		cout << m << endl;
	}
	return 0;
}

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

using namespace std;

vector<int> ans;

int main(){
	while(1){
		int e;
		cin >> e;
		if(e == 0) break;
		int m = 1e9;
		for(int i = 0;i < e;i++){
			if(i*i*i > e) break;
			int iii = i*i*i;
			for(int j = 0;j <= e - iii;j++){
				if(j*j > e - iii) break;
				int jj = j*j;
				int k = e - jj - iii;
				m = min(m,i+j+k);
			}
		}
		ans.push_back(m);
	}
	for(int i = 0;i < ans.size();i++)cout << ans[i] << endl;
	
	return 0;
}

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

using namespace std;

int main(){
    int e;
    while (true) {
        cin >> e; 
        if (!e) {break;} 
        int MIN = 2<<10;
        for (int i = 0; i*i*i <= e; i++) {
            for (int j = 0; i*i*i + j*j <= e; j++) {
                for (int k = 0; i*i*i + j*j + k <= e; k++) {
                    if (e != i*i*i + j*j + k) {continue;}
                    else if (e < i*i*i + j*j + k) {break;}
                    MIN = min(i+j+k, MIN);
                } 
            } 
        }
        cout << MIN << endl;
    }

    return 0;
}

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


int main() {
	int e;
	while (cin >> e && e>0) {
		int y=0;
		int z=0;
		int sum=0,summin=e; // min: NOTICE how we initialize it

		while (y*y*y+z*z*z<e) {
			while (y*y*y+z*z*z<e) {
				x= e-y**3+z**3;	
				sum = x+y+z;
				if (sum < summin) summin = sum;
				++z;
			}
			++y;
		}
		cout << summin << endl;
	}

	return 0;
}

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

using std::cin;
using std::cout;
using std::endl;

int limit(int lim, int exp) {
	int res = 0;
	if (exp > 1) {
		for (int i = 2; pow(i,exp) < lim+1; i++) {
			res = i;
		}
	}
	else {
		for (int i = 0; pow(i,exp) < lim+1; i++) {
			res = i;
		}
	}
	return res;
}

int main(void) {
	int e;
	cin >> e;

	while (e != 0) {
		int m = 0;
		int res;
		int en = e;
		int temp;

		for (int i = 0; i < 10; i++) {
			m = 0;
			en = e;

			temp = limit(en,3);
			m += temp-i;
			en -= pow(temp-i,3);

			temp = limit(en,2);
			m += temp;
			en -= pow(temp,2);

			temp = limit(en,1);
			m += temp;

			if (i == 0) {
				res = m;
			}
			else if (m < res) {
				res = m;
			}
		}
		
		cout << res << endl;
		cin >> e;
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>

#define FOR(i,l,n) for(int (i)=(l);(i)<(n);(i)++)
#define REP(i,n) FOR(i,0,n)

#define MAX_Y 1000
#define MAX_Z 100
using namespace std;

int main(){
    long int x,y,z,e,m=1000000;
    while(cin>>e,e){
        FOR(y,1,MAX_Y+1){
            FOR(z,1,MAX_Z+1){
                x = e-pow(z,3)-pow(y,2);
                if(x>=0&&x+y+z<m)m=x+y+z;
            }
        }
        cout<<m<<endl;
    }
    return 0;
}