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;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int e;
    while (cin >> e, e) {
        int m = 99999999;
        for (int z = 0; z * z * z <= e; z++) {
            for (int y = 0; y * y + z * z * z <= e; y++) {
                int x = e - (y * y + z * z * z);
                m = min(m, x + y + z);
            }
        }
        cout << m << endl;
    }

}

C++: #include<stdio.h>

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

C++: #if 0
16:09-
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2012

#endif

#include <iostream>
#include <stdint.h>
using namespace std;

#define REP(var, start, count) for(int var=start; var<count; var++)

int main(void) {
	while(true) {
		int e;
		cin >> e;
		
		int ans = 10000000;
		
		if ( e == 0 ) { break; }
		
		REP(z, 0, 101) {
			int z3 = z*z*z;
			if ( z3 > e ) { break; }
			
			REP(y, 0, 1001) {
				if ( y*y > e-z3 ) { break; }
				
				int x = (e-z3-y*y);
				int res = x+y+z;
				if ( res < ans ) { ans = res; }
			}
		}
		
		cout << ans << endl;
	}

}

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 <= 1000000 && 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 <algorithm>
using namespace std;

int solve(int e) {
  int m = -1;
  for(int z = 0; z*z*z <= e; ++z) {
    for(int y = 0; z*z*z+y*y <= e; ++y) {
      int x = e - z*z*z - y*y;
      int newValue = x+y+z;
      if(m == -1 || newValue < m) m = newValue;
    }
  }
  return m;
}

int main() {
  int e;
  while(cin >> e && e) cout << solve(e) << endl;
  return 0;
}

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

int main()
{
    int e;
    vector<int> answer;
    while (cin >> e && e != 0)
    {
        int min = 0;
        for (int i = 0; i * i * i <= e; i++)
        {
            for (int j = 0; j * j <= e - i * i * i; j++)
            {
                if (min == 0)
                {
                    min = i + j + (e - i * i * i - j * j);
                }
                else if (min > i + j + (e - i * i * i - j * j))
                {
                    min = i + j + (e - i * i * i - j * j);
                }
            }
        }
        answer.push_back(min);
    }
    for (int i = 0; i < answer.size(); i++)
    {
        cout << answer.at(i) << endl;
    }
    return 0;
}

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/2;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<iostream>
#include<cmath>
using namespace std;
int Bsearch(int n,int e){
  if(e==1)return 1;
  int s,t;
  s=0;t=e;
  int x=e/2;
  while(t-s>1){
    if(pow(x,n)<e){
      s=x;
    }else if(pow(x,n)>e){
      t=x;
    }else{
      break;
    }
    x=(s+t)/2;
  }
  return x;
}

int main(){
  int e;
  while(cin>>e){
    if(e==0)break;
    int x=Bsearch(3,e);
    int y=Bsearch(2,e);
    int minim=1000;
    for(int i=0;i<=x;i++){
      for(int j=0;j<=y;j++){
	int x=e-pow(i,3)-pow(j,2);
	if(x<0)continue;
	minim=min(minim,i+j+x);
      }
    }
    cout << minim << endl;
  }
  return 0;
}

C++: #define rep(i,a) for(int i=0;i<a;i++) 
n;
main(){
	while(scanf("%d",&n),n){
		int mi=999;
		rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?inf:i+j+n-i*i*i-j*j));
		printf("%d\n",mi);
	}
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <string>
using namespace std;

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

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

int main(){
  while(int e = getInt()){
    int m = INT_MAX;
    for(int z = 0; z * z * z <= e; z++){
      int z3 = z * z * z;
      for(int y = 0; y * y + z3 <= e; y++){
	int y2 = y * y;
	int x  = e - z3 - y2;
	m = min(m, x + y + z);
      }
    }
    print(m);
  }
  return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    while (1) {
        int E;
        cin >> E;
        if (!E) break;
        int M = 1000000007;
        for (int z = 0; z <= 100; z++) {
            for (int y = 0; y <= 1000; y++) {
                if (E - z * z * z - y * y < 0) break;
                int x = E - z * z * z - y * y;
                M = min(x + y + z, M);
            }
        }
        cout << M << endl;
    }
}

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

using namespace std;

int main( void )
{
	int e;
	while(cin >> e, e) {
		bool hit = false;
		int answer = 1000001, sq_y = (int)(sqrt((double)e) + 1);
		for(int z=100; z > -1 && !hit; --z) {
			int sum_z = z * z * z;
			if(sum_z == e) { answer = z; break; }
			for(int y=0; y < sq_y; ++y) {
				int sum_zy = sum_z + y * y;
				if(sum_zy == e) { answer = z + y; hit = true; break; }
				else if(sum_zy > e) continue;
				else {
					answer = min(answer, (z + y + e - sum_zy));
				}
			}
		}
		cout << answer << endl;
	}
	return 0;
}