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 <cmath>
using namespace std;

int main(){
  int e;

  while(cin>>e,e){
    if(e==1) cout << e << endl;
    else{
      int x=e,y=pow((double)e,1.0/2.0),z=pow((double)e,1.0/3.0),m=x;
      for(int i=0;i<=y;i++){
        for(int j=0;j<=y;j++){
          for(int k=0;k<=z;k++){
            if(i+(int)pow((double)j, 2.0)+(int)pow((double)k, 3.0)==e&&m>i+j+k){
              m=i+j+k;
            }else if(i+(int)pow((double)j, 2.0)+(int)pow((double)k, 3.0)>e){
              break;
            }
          }
          if(i+(int)pow((double)j, 2.0)>e) break;
        }
      }
      cout << m << endl;
    }
  }

  return 0;
}

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

int main(void){

  int e;

while(1){
    cin >> e;
    int ans = 100000000;
    if(e == 0) break;
      for(int y=0; y <= sqrt(e)+1; y++){
	for(int z=0;z <= cbrt(e)+1; 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>
#include <algorithm>
using namespace std;

int E;
int cnt = 0;
int solve(int e) {
	
		int m = 0x3f3f3f3f;
		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;
				m = min(m, x + y + z);
				++cnt;
			}
		}
		return m;
}
int main() {
	while (cin >> E && E>0) {
		cout << solve(E) << endl;

	}

}

C++: #include <iostream>

using namespace std;

int main(){
	int e;
	while (1){
		cin >> e;
		if (e == 0) break;
		int x = 0, y = 0, z = 0;
		int z3 = 0, y2 = 0;
		int ans;
		while (1){
			z3 = z*z*z;
			if (z3 >= e){
				if (z3 > e){
					z--;
					z3 = z*z*z;
				}
				break;
			}
			z++;
		}
		if (z == 1){
			z3 = 0;
			z = 0;
		}
		while (1){
			y2 = y * y;
			if (z3 + y2 >= e){
				if (z3 + y2 > e){
					y--;
					y2 = y*y;
				}
				break;
			}
			y++;
		}
		if (y == 1){
			y2 = 0;
			y = 0;
		}
		while (1){
			if (x + y2 + z3 == e){
				break;
			}
			x++;
		}
		cout << x + y + z << endl;
	}
	return 0;
}

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

int pow(int a,int b){
    int R=1;
    while(b){
        if(b&1) R=(R*a);
        a=(a*a);
        b>>=1;
    }
    return int(R);
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	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 <iostream>

using namespace std;

int main() {
	int e;
	while (cin >> e) {
		if (e == 0) {
			break;
		}
		int i, j, k, m;
		bool hantei = false;
		for (m = 1; ; m++) {
			if (m*m*m < e) {
				continue;
			}
			for (k = m; k >= 0; k--) {
				for (j = m-k; j >= 0; j--) {
					for (i = m-k-j; i >= 0; i--) {
						if (i+j*j+k*k*k < e) {
							break;
						}
						if (i+j*j+k*k*k == e) {
							hantei = true;
							break;
						}
					}
					if (hantei) {
						break;
					}
				}
				if (hantei) {
					break;
				}
			}
			if (hantei) {
				break;
			}
		}
		cout << m << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <cstdio>
#define rep(i, j) for(int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
using namespace std;
int main()
{
	int e; while (cin >> e && e != 0)
	{
		int m = 214214, x = 0;
		rep(z, 111) rep(y, 1111)
		{
			x = e - (y * y + z * z * z);
			if (e == x + (y * y) + (z * z * z) && x >= 0 ) 
			{ m = min(x + y + z, m); }
		}
		printf("%d\n", m);
	}
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>

using namespace std;

#define MAX_N 128;

int ans;


int main()
{
    int e;
    
    int ans = 100000000;;
    int temp = 10000000;
    
    
    while(cin >> e && e)
    {
        ans = 100000;
        for(int z=0; z<=100; ++z)
        {
            for(int y=0; y<=1000; ++y)
            {
                
                int m = (e-y*y-z*z*z) + y*y + z*z*z;
                if(m == e)
                {
                    int x = e-y*y-z*z*z;
                    if(x < 0){break;}
                    temp = x+y+z;
                    if(ans > temp){ans = temp;}
                }
            }
        }
        cout << ans << endl;
    }
}

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

int E;

int solve(){
  int ans = 1000000;
  for(int z = 0; z * z * z <= E; ++z){
    int F = E - z * z * z;
    for(int y = 0; y * y <= F; ++y){
      int x = F - y * y;
      ans = min(ans, x + y + z);
    }
  }
  return ans;
}

int main(){
  while(scanf("%d", &E) && E > 0){
    printf("%d\n", solve());
  }
}

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

int main() {
	int e;
	while (cin >> e, e) {
		int m = 81671422;
		for (int z = 0; z*z*z <= e; z++) {
			for (int y = 0; y*y + z*z*z <= e; y++) {
				for (int x = 0; x + y*y + z*z*z <= e; x++) {
					if ((x + y*y + z*z*z) > e) break;
					else if ((x + y*y + z*z*z) == e) m = min(m, x + y + z);
				}
			}
		}
		cout << m << endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
	const int intmax  = 1000010;
	ll int e;
	while(cin >> e,e){
		ll int ans = 9999999;
		FOR(y,0,sqrt((double)e)+2){
			FOR(z,0,cbrt((double)e)+2){
				if(e-y*y-z*z*z>=0) ans = min(ans,y+z+(e-y*y-z*z*z));
			}
		}
		cout << ans << endl;
	}
	
}

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

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

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

int Bsearch(int e,int n){
  //cout << n << endl;
  int l=0,r=e;
  int i=(l+r)/2;
  while(r-l>=1){
    i=(l+r)/2;
    //cout << "i:" << i << endl;
    if(e == pow(i,n)){
      //cout << "aaa:" << i << endl;
      return i;
    }else if(e > pow(i,n)){
      l=i+1;
    }else{
      r=i;
    }
  }
  //cout << "i:" << i << endl;
  return i;
}

int a[2000][2000];

int main(){
  int x,y,z,e;
  while(cin>>e,e){
    memset(a,0,sizeof(a));
    y=Bsearch(e,2);
    z=Bsearch(e,3);

    int m=1000000;
    //cout << "z:" << z << " y:" << y << endl;
    for(int i=0;i<=y;i++){
      for(int j=0;j<=z;j++){
	x=e-i*i-j*j*j;
	if(x>=0)m = min(x+i+j,m);
      }
    }
    cout << "ans:" <<m << endl; 
  }
}