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 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 <bits/stdc++.h>
using namespace std;

#define rep(i,n)  for(int i = 0; i < (n); i++)
using vi = vector<int>;
using ll = long long;
const int inf = 1<<30;

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

C++: #include <iostream>

using namespace std;

int main(){
	int e,x,y,z,small ;
	x=0;
	y=0;
	z=0;
	small=10000000;
	while(cin >> e && e>0){
		while(z*z*z <= 1000000){
			while(y*y <= 1000000){
				x = e-y*y-z*z*z;
				if (small > x+y+z){
				small = x+y+z;
				}
			y = y+1;
			}
		z = z+1;
		}
	cout << small << endl ;
	}
}

C++: #include<iostream>

using namespace std;

int main(){
  int e;
  int minimum = 10000000, n= 0;
  while(1){
    minimum = 10000000;
    cin >> e;
    if(e == 0) break;
    for(int i = 0; i<100; i++){
      for(int j = 0; j<1000; j++){
	n = e - i*i*i -j * j;
	if(n+ i+ j < minimum && n>= 0) minimum = n+ i+ j;
      }
    }
    cout << minimum << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<climits>
using namespace std;
	int main(){
		int e,m,p,q,r,min,x;
		while(cin>>e,e){
			min=INT_MAX;
			for(int z=0;z*z*z<=e;z++)
			for(int y=0;y*y+z*z*z<=e;y++){
				x=e-z*z*z-y*y;
				if(x+y+z<min)
				min=x+y+z;
			}
			cout<<min<<endl;
		}
		return 0;
	}

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

int main(void)
{
	int e, min;
	int x, y, z;

	while(cin >> e && e != 0)
	{
		min = e;
		for(z = 0; z*z*z <= e; z++)
		{
			for(y = 0; y*y <= e - z*z*z; y++)
			{
				x = e - z*z*z - y*y;

				if(x+y+z < min)
					min = x + y + z;
			}
		}
		cout << min << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
 
int main(void)
{
  int i,j,k,l;
  while(1) {
	int x,y,z;
	int e;
	int tmp_ans,ans;
	scanf("%d",&e);
	if(e == 0) break;
	tmp_ans = e;
	for(z=0;z*z*z < e;z++) {
	  for(y=0;;y++) {
		x = e - z*z*z - y*y;
		if(0 > x) break;
		if(tmp_ans > x+y+z)
		  tmp_ans = x+y+z;
	  }
	}
	ans = tmp_ans;
	printf("%d\n",ans);
  }
   return 0;
}

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

using namespace std;

int main() {

  int e,x,y,z;

  for(;;){
    cin >> e;
    if(!e)break;
    int xm = e;
    int ym = (int)sqrt(e)+1;
    int zm = (int)cbrt(e)+1;

    int f,g1,g2,g3,m=3*e;
    for(int i=zm;0<i;--i){
      g1=i*i*i;
      if(g1<e)
	for(int j=0;j<ym;++j){
	  g2=i*i*i+j*j;
	  if(g2<e){
	    int k=e-i*i*i-j*j;
	    f=i+j+k;
	    if(f<m)m=f;
	  }
	}
    }
    
    cout << m << endl;
  }
  
}

C++: #if 0

#endif

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int E;
int solve(int E) {
  int ans = 1e9;
  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;
      if (x+y*y+z*z*z == E)
        ans = min(ans, x+y+z);
    }
  return ans;
}

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

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

int main(){
  int i,j,k,e,x,y,z,m;
  while(1){
    int min=1000000;
    cin >> e;
    if(e==0)break;
   
    for(x = 0; x < 100; x++){
      for(y = 0; y < 100; y++){
	for(z = 0; z < 100; z++){
	  if(x+y*y+z*z*z==e){
	    m=x+y+z;
	    if(m<min)min=m;
	    // cout << m << endl;
	  }
	}
      }
    }
     cout << min << endl;
  }
  return 0;
}

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

int main(){
  int E;
  cin >> E;
  int min=E;
  int sum;
  for(int z=0;z<=100;z++){
    for(int y=0:y*y<E-z*z*z;y++){
      sum=(E-y*y-z*z*z)+y+z;
      if(min>sum) min=sum;
    }
  }
  return min;
}

C++: #include<cstdlib>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<cstring>
#include<cmath>
using namespace std;
const int MAXN = (int) 5e5 + 10;
const int INF = (int) 0x3f3f3f3f;
typedef long long LL;

int E;

void work(){
    while(~scanf("%d",&E)&&E){
        int m=INF;
        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);
            }
        }
        printf("%d\n",m);
    }
}

int main(){
#ifdef NNever
//    freopen("data.in","r",stdin);
//    freopen("out.txt","w",stdout);
#endif // NNever
    work();
    return 0;
}

C++: #include <iostream>
using namespace std;
int E;
int solve(int E);

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

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

int e = 0;

int solve(){
    int x,y,z;

    int y_max, z_max;
    for(x=0; x<=e; ++x){
        y_max = pow(e-x, 0.5) + 1;
        for(y=0; y<=y_max; ++y){
            z_max = pow(e-x-y*y, 0.34) + 1;
            for(z=0; z<=z_max; ++z){
                if((x+y*y+z*z*z) == e){
                    return x + y + z;
                }
            }
        }
    }
    return 0;
}

int main(void){
    while(true){
        std::cin >> e;
        if(e == 0) break;
        std::cout << solve() << std::endl;
    }
}

C++: #include<iostream>
using namespace std;
int main(){
	int n;
	//x+y*y+z*z*zの、xが最少となるyとzの組み合わせを探す。
	while(cin>>n,n){
		int ans=0,now=n,now2=n,ans2=0,tmp=10e8;
			for(int i=0;i*i<=n;i++){
				for(int j=0;j*j*j<=n;j++){
					if(n-i*i-j*j*j>=0&&n-i*i-j*j*j<tmp){
						tmp=n-i*i-j*j*j;
						ans=i+j+(n-i*i-j*j*j);
					}
				}
			}
			cout<<ans<<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, 1000) rep(y, 10000)
		{
			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 <iostream>

using namespace std;

int main(){
	int e; cin >> e;
	while(e){
		int min = 1 << 21;
		for(int i = 0; i * i * i <= e; i++){
			for(int j = 0; j * j + i * i * i <= e; j++){
				if(e - (i * i * i + j * j) + j + i < min){
					min = e - (i * i * i + j * j) + j + i;
				}
			}
		}
		cout << min << endl;

		cin >> e;
	}
	return 0;
}