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

int e, m;

int main(void){
  while(cin >> e && e != 0){
    m = 1000000;
    for(int y = 0; y <= 1000; y++){
      for(int z = 0; z <= 100; z++){
        int x = e - y * y - z * z * z;
        if(x < 0) continue;
        if(x + y + z < m) m = x + y + z;
      }
    }
    cout << m << endl;
  }
  return 0;
}

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

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

int main(){

  int e, cpy;

  while(cin >> e && e){

    int m = INT_MAX;

    for(int i = 0; i*i <= e; i++){
      for(int j = 0; j*j*j <= e; j++){
	cpy = e - i*i - j*j*j;
	if(e == i*i + j*j*j + cpy && cpy >= 0){
	    m = min(m,i+j+cpy);
	}
      }
    }
    cout << m << endl;

  }

 
}

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

using namespace std;

int main(void) {
	int e;
	while(1) {
		cin >> e;
		if(e == 0) {
			break;
		}
		
		int tmpx, tmpy, tmpz, tmpe;
		tmpe = e;
		tmpz = pow(e, 1.0 / 3.0);
		tmpe = tmpe - pow(tmpz, 3);
		if(tmpe == 0){
			tmpy = 0; tmpx = 0;
		}else{
			tmpy = pow(tmpe, 1.0 / 2.0);
			tmpe = tmpe - pow(tmpy, 2);
			if(tmpe == 0){
				tmpx = 0;
			}else{
				tmpx = tmpe;
			}
		}
		int tmpm = tmpx + tmpy + tmpz;

		int tmp;
		for(int z = 0; z <= tmpz; z++) {
			for(int y = 0; y <= min(tmpm - z, int(pow(e - pow(z, 3), 1.0 / 2.0))); y++) {
				int x = e - pow(y, 2) - pow(z, 3);
				tmp = x + y + z;
				if(tmp < tmpm) {
					tmpm = tmp;
				}
			}
		}

		cout << tmpm << endl;
	}
	return 0;
}

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

#define rep(i, n) for(int i = 0; i < n; i ++)
#define COUNT(i, n) for(int i = 1; i <= n; i ++)
#define ALL(T) T.begin(), T.end()
#define mp make_pair
#define pb push_back
#define ITER(c) __typeof((c).begin())
#define each(c, it) for(ITER(c) it = (c).begin(); it != (c).end(); it++)
#define X first
#define Y second

using namespace std;

typedef pair<int, int> pii;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;
const int N = 1000001;

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

    return 0;
}

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

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

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

		}

		cout << min << endl;
	}
}

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

using namespace std;

int main(){

int e;
int x,y,z;

while(cin >> e){
if(e==0){
return 0;
}
int m;
for(int i=0;i*i<e;i++){
for(int j=0;j*j*j<e;j++){
if(e%j*j*j==0){
m=j;
}
else if(e%j*j*j!=0&&e%i*i==0){
m=i;
}
else if(e%j*j*j!=0&&e%i*i!=0){
m=e;
}
}
}
cout << m << endl;
}
return 0;
}

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

int table[1000010];
int table2[1000010];

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

	for(int i = 0, y = 0; i < 1000010; i++) {
		while(y * y <= i) y++;
		table[i] = (y - 1) + (i - (y - 1) * (y - 1));
	}

	for(int i = 0, z = 0; i < 1000010; i++) {
		table2[i] = table[i];
		for(z = 0; z * z * z <= i; z++) {
			if(table[i] > z + table[i - z * z * z]) {
				if(table2[i] > z + table[i - z * z * z])
					table2[i] = z + table[i - z * z * z];
			}
		}
	}

	while(cin >> e, e) {
		cout << table2[e] << endl;
	}
}

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

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

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

using namespace std;

int main() {
	int hyou[11];
	for (int i = 0; i < 11; i++) {
		hyou[i] = i*i*i;
	}
	int e;
	while (cin >> e) {
		if (e == 0) {
			break;
		}
		int a, b, c;
		for (int i = 10; i > 0; i--) {
			if (e >= hyou[i]) {
				c = i;
				break;
			}
		}
		for (int i = 1; ;i++) {
			if (i*i > e-hyou[c]) {
				b = i-1;
				break;
			}
		}
		for (int i = 1; ;i++) {
			if (i > e-hyou[c]-b*b) {
				a = i-1;
				break;
			}
		}
		int MIN = a+b+c;
		for (int i = c-1; i >= 0; i--) {
			for (int j = b+1; ; j++) {
				if (j*j > e-hyou[i]) {
					b = j-1;
					break;
				}
			}
			int q = e-hyou[i]-b*b;
			MIN = min(MIN, b+q+i);
		}
		cout << MIN << 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)
	{
		int m = 214214, x = 0;
		rep(z, 101) rep(y, 1001)
		{
			x = e - (y * y + z * z * z);
			if (e == x + (y * y) + (z * z * z) && x >= 0 ) 
			{ m = min(x + y + z, m); }
			else if (e > x + (y * y) + (z * z * z)) { break; }
		}
		printf("%d\n", m);
	}
	return 0;
}

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

const int INF = 1 << 30;

void solve(int E) {
    int ans = INF;
    for (int z = 100; z >= 0; z--) {
        if (z * z * z > E) continue;
        int rest = E - z * z * z;
        for (int y = 1000; y >= 0; y--) {
            if (y * y > rest) continue;
            int x = rest - y * y;
            ans = min(ans, x + y + z);
        }
    }
    cout << ans << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int E;
    while (true) {
        cin >> E;
        if (E == 0) break;
        solve(E);
    }
    return 0;
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define REAP(i,a,n) for(int i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()
typedef long long ll;

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

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

const int LLINF = 1LL << 60;

signed main()
{
  
  int Z[105], Y[1005];
  
  for(int i = 0; i <= 1000; i++) {
    if(i * i <= 1000000) {
      Y[i] = i * i;
    }
    if(i * i * i <= 1000000) {
      Z[i] = i * i * i;
    }
  }
  
  int E;
  while(cin >> E, E) {
    
    int minv = LLINF;
    
    for(int i = 0; i <= 100; i++) {
      for(int j = 0; j <= 1000; j++) {
	if(Z[i] + Y[j] <= E) {
	  minv = min(i + j + E - (Z[i] + Y[j]), minv);
	}
      }
    }
    
    cout << minv << endl;

  }
  
  return 0;
}