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 <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 <= 100; 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<cstdio>

#define MIN(X,Y) ((X<Y)?(X):(Y))

int trrt(int x) {
    int a,b;
    a=-1000;
    b=10000;
    while(b-a>1) {
        int m = (a+b)/2;
        if(m*m*m > x)
            b = m;
        else
            a = m;
    }
    return b;
}
int sqrt(int x) {
    int a,b;
    a=0;
    b=10000;
    while(b-a>1) {
        int m = (a+b)/2;
        if(m*m > x)
            b = m;
        else
            a = m;
    }
    return b;
}

int main(void) {
    while(true) {
        int e,res=1e6;
        scanf("%d", &e);
        if(!e) break;

        int zmax = trrt(e)*2;
        for(int z=0; z<zmax; z++) {
            int ymax = sqrt(e-z*z*z)*2;
            for(int y=0; y<ymax; y++) {
                int x = e - y*y - z*z*z;
                if(x<0) continue;

                res = MIN(x+y+z, res);
            }
        }

        printf("%d\n", res);
    }
    return 0;
}

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

int main() {
  int e;
  while (scanf("%d", &e) != EOF && e) {
    int m = 10000;
    for (int z=0; z<m; z++) {
      if (e < z*z*z) {
	break;
      }
      for (int y=0; y<m; y++) {
	if (e < y*y + z*z*z) {
	  break;
	}
	for (int x=0; x<m; x++) {
	  if (e == x + y*y + z*z*z && x+y+z < m) {
	    m = x + y + z;
	  } else if (e < x + y*y + z*z*z) {
	    break;
	  }
	}      
      }      
    }
    printf("%d\n", m);
  }
}

C++: #include <cstdio>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>

using namespace std;


int main() 
{
	int n;
	while(cin >> n && n>0)
	{
		int ans = 2000000;
		for(int i = 0;i<101;i++)
		{
			for(int j=0;j<1001;j++)
			{
				if((n-i*i*i-j*j)>-1)
				{
					if(ans>(i+j+n-i*i*i-j*j))
					{
						ans = i+j+n-i*i*i-j*j;
					}
				}
			}
		}
		cout << ans << endl;
	}
	return 0 ;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <iomanip>
#include <algorithm>
using namespace std;

int main() {
  long long n;
  while (cin >> n) {
	if (n == 0) break;
	long long res = n;
	for (long long a = 0; a * a * a <= n; ++a) {
	  for (long long b = 0; a * a * a + b * b <= n; ++b) {
		res = min(res, a + b + (n - a*a*a - b*b));
	  }
	}
	cout << res << endl;
  }
}

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

int main() {
	int e, m, a, x;
	double c, d;
	while (true) {
		cin >> e;
		if (e == 0) break;
		m = 90000000;

		c = pow(e, 1.0 / 3.0);
		d = sqrt(e);
		for (int z = 0; z <= c + 1; z++) {
			for (int y = 0; y <= d; y++) {	
				x = e - y*y - z*z*z;
				if (x < 0) break;
				else {
					a = x + y + z;
					if (a < m) m = a;
				}
			}
		}

		cout << m << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
#define ll long long 
int main(){
  ll e;
  while(cin >> e && e){
    ll m = 100000000000;
    for(ll z = 0; z * z * z <= e; z++){
      for(ll y = 0; y * y + z * z * z <= e; y++){
	m = min(m, y + z + e - y * y - z * z * z);
      }
    }
    cout << m << endl;
  }
}

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

using namespace std;

int main()
{
    unsigned long long e;
    while( cin >> e ) {
        if ( e == 0 )
            break;

        cout << [&]() mutable -> unsigned long long
        {
            const unsigned short y_max = sqrt( e ) + 10;
            const unsigned short z_max = cbrt( e ) + 10;
            for( unsigned int x=0; x<=e; ++x ) {
                for( unsigned short y=0; y<=y_max; ++y ) {
                    for( unsigned short z=0; z<=z_max; ++z ) {
                        unsigned long long const v = x + y*y + z*z*z;
                        if ( v > e )
                            break;
                        if ( v == e ) {
                            return x + y + z;
                        }
                    }
                }
            }
            return 0;
        }() << endl;
    }
}

C++: #include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <complex>

using namespace std;

int main(){

    int e;

    while(cin>>e,e){

        int x,y,z;
        int answer = 1000000;
        /*for(int i=0;i<=e;i++){
            for(int j=0;j<=sqrt(e)-i;j++){
                for(int k=0;k<=pow(e,1.0/3.0)-i+pow(j,2.0);k++){
                    if(i+pow(j,2.0)+pow(k,3.0)==e&&answer>i+j+k){
                        answer = i+j+k;
                    }
                }
            }
        }*/

        for(int k=0;k*k*k<=e;k++){
            for(int j=0;j*j<=e-k*k*k;j++){
                int i=e-j*j-k*k*k;
                    if(i+pow(j,2.0)+pow(k,3.0)==e&&answer>i+j+k){
                        answer = i+j+k;
                    }
            }
        }

        cout<<answer<<endl;
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

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

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

int main(void){
    long long e, x1, xmin;
    while(cin >> e){
        xmin=0;
        if(e == 0)  break;
        for(long i = 0; i*i <= e; i++){
        for(long j = 0; i*i+j*j*j <= e; j++){
            x1 = e - i*i - j*j*j;
            if(x1 < 0)  break;
            if(xmin == 0 || xmin > (x1 + i + j))
            xmin = x1 + i + j;
        }
        }
        cout << xmin << endl;
    }
    return 0;
}

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

int main(){

	long int e;

	cin >>e;

	while(!(e == 0)){
		long int ans = 2000000;

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

C++: //
//  main.cpp
//  Exercise
//
//

#include <algorithm>
#include <iostream>
#include <limits>
#include <math.h>
#include <tuple>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "string.h"
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <set>

using namespace std;

using int_t = long long;

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2012

int main() {
    while (true) {
        int e;
        scanf("%d", &e);
        if (e == 0) {
            return 0;
        }
        int sumMin = numeric_limits<int>::max();
        for (int y = 0; y * y <= e; y++) {
            for (int z = 0; z * z * z <= e - y * y; z++) {
                int x = e - y * y - z * z * z;
                sumMin = min(sumMin, x + y + z);
            }
        }
        printf("%d", sumMin);
    }
    return 0;
}