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()
{
  while(1){
    int e;
    cin>>e;
    if(e == 0){
      break;
    }

    int ans;
    bool check = false;
    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(check == false){
          ans = x + y + z;
          check = true;
        }
        else{
          ans = min(ans,x+y+z);
        }
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int e,ans;
int main(){
  while(1){
    cin>>e;
    if(e==0)break;
    ans=e;
    for(int y=0;y*y<=e;y++){
      for(int z=0;z*z*z+y*y<=e;z++){
	int x=e-y*y-z*z*z;
	ans=(ans<x+y+z?ans:x+y+z);
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

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

int main(void){

  int e;

  while(1){
    int ans = 1000000000;
    cin >> e;
    if(e == 0) break;

    for(int x=0; x <= sqrt(e); x++){
    for(int y=0; y <= sqrt(e); y++){
      for(int z=0;z <= pow(e, 1.0 / 3.0); z++){
	if(e == x + y*y + z*z*z){
	  ans = min(ans,x+y+z);
	  cout << x << ' ' << y << ' ' << z << endl;
	}
      }
    }
  }

  cout << ans << endl;
  }
  return 0;
}

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

using namespace std;

void solve()
{
	int e;
	while(cin >> e, e)
	{
		int min_val = 999999999;
		for(int z = 0; z <= 100; ++z)
		{
			if(e < z * z * z)
			{
				break;
			}
			for(int y = 0; y <= 1000; ++y)
			{
				int temp = z * z * z + y * y;
				if(e < temp)
				{
					break;
				}
				int x = e - temp;
				min_val = min(min_val, x + y + z);
			}
		}
		cout << min_val << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <bits/stdc++.h>
#define FOR(i, a, n) for(int i = a, i < n, i++)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

int solve(int e){
  int x, y, z;
  int y2, z3;
  int y_end, z_end;
  int m = INT_MAX / 2;
  for(z = 0; z < e; z++){
    z3 = z * z * z;
    if(z3 > e) break;
    for(y = 0; y < e; y++){
      y2 = y * y;
      if(z3 + y2 > e) break;
      x = e - z3 - y2;
      if(x < 0) break;
      m = min(x + y + z, m);
    }
  }
  return m;
}

int main(){
  while(true){
    int e;
    scanf(" %d", &e);
    if(e == 0) break;
    printf("%d\n", solve(e));
  }
}

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

int main(){

  int e;

  while(cin >> e && e){

    int m = INT_MAX;

    for(int i = 0; i <= sqrt(e); i++){
      for(int j = 0; j <= pow(e, 1.0/3.0); j++){
	for(int t = 0; t <= e - j - i; t++){
	  if(e == pow(i,2) + pow(j,3) + t){
	    m = min(m,i+j+t);
	  }
	}
      }
    }
    cout << m << endl;

  }

 
}

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

using namespace std;
using LL = long long;
using P = pair<int, int>;
using Tapris = tuple<int, int, int>;

#define REP(i, n) for(LL i = 0; i < n; ++i)
#define FOR(i, a, n) for(LL i = a; i < n; ++i)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e15;
const int MOD = 1e9 + 7;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

//#define int long long

/*************** using variables ***************/
int e;
int m = INF;
/**********************************************/

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

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

        cout << m << endl;
    }
}

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

int main(){

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

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

using namespace std;

int main() {
  int e;
  while(cin>>e && e) {
    int ans = INT_MAX;
    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;
	  }
	}
      }
    }
    cout<<ans<<endl;
  }
}

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

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;}
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
//bool scan(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
//vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T> vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef vo

int main() {
	for (int e, m; (e = m = in());) {
		for (int z = cbrt(e); z >= 0; z--) {
			int te = e - z * z * z;
			int y = (int)sqrt(te);
			int tm = z + y + te - y * y;
			m = min(m, tm);
		}
		out(m, '\n');
	}
}

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

int main(){
	int e,m,a;
	
	while(1){
		cin >> e;
		m=e;
		if(e==0){
			return 0;
		}
		for(int i=0;i<m;i++){
			for(int j=0;j<m-i;j++){
				a=e-i*(i-1)-j*(j-1)*(j+1);
				if((a>=i+j)&&(m>a)&&(a>=0)){
					m=e-i*(i-1)-j*(j-1)*(j+1);
				}
				if(a<0){
					break;
				}
			}
		}
		cout << m <<"\n";
	}
			
return 0;
}

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

C++: #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
  int E,tmp,z,y,x,i;
  cin >> E;
  if (E<0 || 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 << "E = " << E << endl;
  cout << "(x,y,z) = (" << x << "," << y << "," << z << ")" << endl;
  cout << "x+y+z = " << x+y+z << endl;
}