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 smallest = 1000000;
int x, threez, N;
int main()
{
while (cin >> N && N != 0) {
    smallest = 1000000;
            for(int z = 0; pow(z, 3) <= N; z++) {
                threez = pow(z, 3);
                for(int y = 0; pow(y, 2) <= N - threez; y++) {
                    x = N - threez - pow(y, 2);
                    if (x + y + z < smallest) {
                        smallest = x + y + z;
                    }
                }
            }
            cout << smallest << endl;
}
}

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

int main(){
  int e;

  while(cin>>e, e){
    int ans = INT_MAX;

    for(int z = 0; z * z * z <= e; z++){
      int zp = z * z * z;

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

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

    cout << ans << endl;
  }
}

C++: #include<bits/stdc++.h>

#define ll long long
#define inf 1000000000
using namespace std;


int e;

int yy(int a){
		int i=0;
		while(i*i<=a){
				if(i*i==a)return i;
				i++;
		}
		return inf;
}

int zzz(int a){
		int i=0;
		while(i*i*i<=a){
				if(i*i*i==a)return i;
				i++;
		}
		return inf;
}

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

C++: #include<iostream>
using namespace std;
#define x e-(y*y+z*z*z)
int main()
{
  int a,e;
  for(;cin>>e,e;cout<<a<<endl)
    {
      a=e;
      for(int y=0;y*y<=e;y++)
	for(int z=0;y*y+z*z*z<=e;z++)
	  if(x>=0&&x+y+z<a)
	    a=x+y+z;
    }
}

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

using namespace std;

int main() {
  int e;
  while(cin>>e && e) {
    int ans = INT_MAX;
    bool flag = false;
    for(int x=0; x<e; x++) {
      for(int y=0; y<=sqrt(e) && x+y*y<=e; y++) {
	for(int z=0; z<=pow(e,0.333)+1 && x+y*y+z*z*z<=e; z++) {
	  if(x+y*y+z*z*z==e && x+y+z<ans) {
	    ans = x+y+z;
	  }
	  if(flag == true) break;
	}
	if(flag == true) break;
      }
      if(flag == true) break;
    }
    cout<<ans<<endl;
  }
}

C++: #include <iostream>
using namespace std;
void k(int,int);
int m;
int main(){
  int e,i,j,k;
  while(1){
    m=10000000;
    cin >> e;
    if(e==0) break;
    for(i=0;i<=100;i++){
      for(j=0;j<=1000;j++){
	k=e-j*j-i*i*i;
        if(k>=0&&m>i+j+k){
	  m=i+j+k;
	}
      }
    }
    cout << m << endl;
  }
  return 0;
}

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

int main() {
	long long e,x,y,z,min,k;
	for (;;) {
		x = y = z = k = 0, min = 1000000;
		cin >> e;
		if (e == 0) return 0;
		for(int i=0;i<sqrt(e);i++)
			for (int j = 0; j < pow(e,1.0/3.0); j++) {
				k = e - i*i - j*j*j;
				if (k>0&&min > i + j + k) {
					min = i + j + k;
					x = k, y = i, z = j;
				}
			}
		cout << x + y + z << endl;
	}
	return 0;
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
typedef long long ll;
typedef pair<int,int> P;

template<typename A,typename B> inline void chmin(A &a,B b){if(a>b) a=b;}
template<typename A,typename B> inline void chmax(A &a,B b){if(a<b) a=b;}
//-----------------------------------------------------------------------

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

    int e;
    while(cin>>e,e)
    {
        int ans=1e9;
        for(int z=0;e-z*z*z>=0;z++){
            for(int y=0;e-z*z*z-y*y>=0;y++){
                int x=e-z*z*z-y*y;
                chmin(ans,x+y+z);
            }
        }
        cout<<ans<<endl;
    }
}

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

int main()
{
  int e;
  int x = 0;
  int y = 0;
  int z = 0;
  while(cin >> e && e > 0){
    int min = e;
    int zmax = ceil(pow(e, 1.0/3.0));
    int ymax = ceil(pow(e, 1.0/2.0));
    for(int i=0; i<=zmax; i++){
      for(int j=0; j<=ymax; j++){
        int y2 = j * j;
        int z3 = i * i * i;
        x = e - y2 - z3;
        if(x >= 0 && min > x + i + j){
          min = x + i + j;
        }
      }
    }
    cout << min << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
  int E,tmp,z,y,x,i;
  while (cin >> E && E>0){
    if (E>1000000){
    cout << "Incorrect input" << endl;
    exit(1);
    }
    for (i=0;i*i*i<=E;i++){
    }
    i--;
    z=i;
    tmp = E-z*z*z;
    for (i=0;i*i<=tmp;i++){
    }
    i--;
    y=i;
    x=tmp-y*y;
    cout << x+y+z << endl;
  }
}

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

int main() {
  int e;
  while (cin >> e, e != 0) {
    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) {
	    cout << x + y + z << endl;
	    goto END;
	  }
	}
      }
    }
  END:
    e;
  }

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int e,min;
  while(cin >> e && e){
    if(e == 1)cout << 1 << endl;
    else{
      min = 1000001;
      for(int i=0;i<=e;i++){
	for(int j=0;j<=e-i*i*i;j++){
	  for(int k=0;k<=e-i*i*i-j*j;k++){
	    if(i*i*i+j*j+k == e){
	      if(min > i + j + k)min = i+j+k; 
	    }
	  }
	}
      }
      cout << min << endl;
    }
  }
}

C++: #include "bits/stdc++.h"
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cout << #x << " : " << (x) << " --------------" << endl;
using namespace std;

int main(void){
    int e;
    while (cin >> e, e) {
        int m = 1000000;
        for (int z = 100; z >= 0; --z) {
            int val = z * z * z;
            if (val > e) continue;
            for (int y = sqrt(e-val); y >= 0; --y) {
                int val2 = val + y * y;
                if (val2 > e) continue;
                m = min(m, (e - val2) + y + z);
            }
        }
        cout << m << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr,__VA_ARGS__)
//#define LOG(...)
#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 ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(a) ((int)(a).size())
#define BIT(x, i) (((x) >> (i)) & 1)

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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

C++: #include<iostream>
#include<cmath>
using namespace std;
int main()
{
  int x,y,z,m;
  double e;
  while(cin>>e,e){
    m=1000000;
    for(z=0;z*z*z<=e;z++){
      y=(int)pow(e-z*z*z,0.5);
      x=e-y*y-z*z*z;
      if(m>x+y+z)m=x+y+z;
    }
    printf("%d\n",m);
  }
}