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 <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>
using namespace std;

#define min(a,b) (a<b?a:b)

int main() {
	int e, x, yy, zzz, ans;
	while(1) {
		cin >> e;
		if(!e) break;
		ans = 1000000;
		for(int i=0;; ++i) {
			zzz = i*i*i;
			if(zzz>e) break;
			for(int j=0;; ++j) {
				yy = j*j;
				if(yy>e-zzz) break;
				x = e-yy-zzz;
				ans = min(ans, x+i+j);
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int N,A[10010];
int min()
{
    int i;
    int min=A[0];
    for(i=0;i<N;i++)
    {
        if(A[i]<min)
            min=A[i];
    }
    return min;
}
int max()
{
    int i;
    int max=A[0];
    for(i=0;i<N;i++)
    {
        if(A[i]>max)
            max=A[i];
    }
    return max;
}
long long sum()
{
    long long sum=0;
    int i;
    for(i=0;i<N;i++)
    {
        sum+=A[i];
    }
    return sum;
}
int main()
{
    cin>>N;
    for(int i=0;i<N;i++)
    {
        cin>>A[i];
    }
    cout<<min()<<' '<<max()<<' '<<sum()<<endl;
}

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

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()
#define range(x,min,max) ((min) <= (x) && (x) <= (max))
#define xyrange(x, minX, maxX, y, minY, maxY) (range(x, minX, maxX) && range(y, minY, maxY))

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef pair<int,int> PII;
typedef vector<PII> VPII;

int e;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};
const int INF = INT_MAX / 2;

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	while (1) {
		cin >> e;
		if (e == 0) break;
		LL ans = INF;
		int dx, dy, dz;
		for (LL z = 0;z < 100 + 1;z++) {
			for (LL y = 0;y < 1000 + 1;y++) {
				if (e - z * z * z - y * y < 0) continue;
				LL x = e - z * z * z - y * y;
				ans = min(ans, x + y + z);
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main(){
	long long E, sum=1000000;
	int y,z;
	long long x= E-z*z*z-y*y;
	while(scanf("%ld",&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("%ld\n",sum);
	}
        return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	for(int e;cin>>e,e;){
		int res=1000000;
		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);
				res=min(res,x+y+z);
			}
		cout<<res<<endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<stack>
#include<queue>
#include<sstream>
#include<string>
#include<bitset>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i);

using namespace std;

int main(){

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

		int ans=1<<28;

		rep(z,101){
			rep(y,1001){
				int x = e - ((z*z*z)+(y*y));
				if(x<0) continue;
				ans=min(ans,x+y+z);
			}
		}
	
		cout << ans << endl;
	}

	return 0;
}

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

C++: #include<stdio.h>

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

C++: #include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>

using namespace std;

#define MAX_N 128;

int ans;


int main()
{
    int e;
    
    int ans = 100000000;;
    int temp = 10000000;
    
    
    while(cin >> e && e)
    {
        ans = 100000;
        for(int z=0; z<=100; ++z)
        {
            for(int y=0; y<=1000; ++y)
            {
                
                int m = (e - y*y - z*z*z) + y*y + z*z*z;
                if(m == e)
                {
                    int x = e - y*y - z*z*z;
                    if(x < 0){break;}
                    if(ans > x+y+z){ans = x+y+z;}
                }
            }
        }
        cout << ans << endl;
    }
}

C++: #include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;


vector<int>  dx = {1,-1,0,0};
vector<int>  dy = {0,0,1,-1};


int main() {

	while(1) {
		int n; cin >> n;
		if (n == 0) break;
		int min = 1000000001;
		/*
		for (int x = 0; x <= n; x++) {
			if (x > n) break;
			for (int y = 0; y <= n; y++) {
				if (x + y * y > n) break;
				for (int z = 0; z <= n; z++) {
					int energy = x + y * y + z * z * z;
					int m = x + y + z;
					if (energy > n) break;
					if (energy == n and min > m) {
						min = m;
					}
				}
			}
		}
		*/
		for (int z = 0; z <= n; z++) {
			if (z * z * z > n) break;
			for (int y = 0; y <= n; y++) {
				int x = n - (z * z * z + y * y);
				int m = x + y + z;
				if (x < 0) break;
				if (min > m) {
					min = m;
				}
			}
		}
		cout << min << endl;
	}
	return 0;
}

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

int main(){
  int e;

  while(cin>>e,e){
    if(e==1) cout << e << endl;
    else{
      int x=e,y=pow((double)e,1.0/2.0),z=pow((double)e,1.0/3.0),m=x;
      for(int i=0;i<(int)pow((double)x, 1.0/2.0);i++){
        for(int j=0;j<=y;j++){
          for(int k=0;k<=z;k++){
            if(i+pow((double)j, 2.0)+pow((double)k, 3.0)==e&&m>i+j+k){
              m=i+j+k;
            }
          }
        }
      }
      cout << m << endl;
    }
  }

  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define between(a,x,b) ((a)<=(x)&&(x)<=(b))
#define INF 1 << 30

using namespace std;

int main(){
  int e;
  while(scanf("%d", &e) && e){
    int res = INF;
    for(int i = 0; i * i * i <= e; i++){
      int z = i;
      int y = sqrt(e-z*z*z);
      int x = e-(y*y+z*z*z);
      res = min(res, z + y + x);
    }

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