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)
    }
}

Python: import math
targ = int(input())
while True:
    minans = float("inf")
    if (targ ** ( 1 / 3)) == int(targ ** ( 1 / 3)):
        z = int(targ ** ( 1 / 3))
        targ = 0
    elif (targ ** ( 1 / 2)) == int(targ ** ( 1 / 2)):
        y = int(targ ** ( 1 / 2))
        targ = 0
    else:
        for n in range(math.ceil(targ ** ( 1 / 3))):
            if minans == 0:
                break
            for m in range(math.ceil(targ ** ( 1 / 2))):
                if (n ** 3) + (m **2) > targ:
                    break
                if minans > targ - (n ** 3 + m ** 2) + n + m:
                    minans = targ - (n ** 3 + m ** 2) + n + m
    if minans != float("inf"):
        print(minans)
    else:
        print(y + z)
    targ = int(input())
    if targ == 0:
        break

Python: while(True):
  e = int(input())
  if e == 0:
    quit()
  ans = e
  for i in range(0,int(e ** (1/3))+1):
      j = int((e - i ** 3)**0.5)
      k = e - i ** 3 - j ** 2 + i + j
      if k < ans:
          ans = k
  print(ans)

Python: while True:
    e = int(input())
    if e == 0:
        break
    
    m = e + 1
    y = 0
    while y ** 2 <= e:
        z = 0
        while y ** 2 + z ** 3 <= e:
            x = e - y ** 2 - z ** 3
            m = min(m, x + y + z)
            z += 1
        y += 1
    print(m)

Python: while 1:
    e = int(input().strip())
    if e ==0:break
    m=e
    z =0
    '''
    while z**3 <= e:
        y=0
        while y **2 <= e - z**3:
            x = e - y**2 - z**3 
            if m > x+y+z: m = x+y+z 
            y+=1
        z+=1
    '''
    print(m)

Python: def main():
    while True:
        e = int(input())
        if e==0:
            return
        m = e
        z = int(e**(1/3))
        while z >= 0:
            y = int(int(e-z**3)**(1/2))
            while y >= 0:
                x = e - z**3 - y**2
                m = min(m, x+y+z)
                y -= 1
            z -= 1
        print(m)

if __name__ == '__main__':
    main()

Python: import math
while 1:
    e = int(input())
    if  e == 0 :break
    m = e
    for z in range(int(math.sqrt(e)) + 1):
        for y in range(int(math.sqrt(e))+ 1):
            x = e - y**2-z**3
            if  x <0:break
            if m > x+y+z: m = x+y+z
    print(m)

Python: import sys

inf = 1<<30

def solve():
    while 1:
        e = int(sys.stdin.readline().rstrip())

        if e == 0:
            return

        ans = inf

        for z in range(int(e**(1/3)) + 1):
            rest = e - z**3
            y = int((rest)**0.5)
            x = rest - y**2

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

        print(ans)

if __name__ == '__main__':
    solve()

Python: while(1):
    e = int(input())
    if e == 0:
        break
    m, z = 10 ** 15, 0
    while z**3 <= e:
        y = int((e - z**3) ** 0.5)
        x = e - z**3 - y ** 2
        m = min(m, x + y + z)
        z += 1
    print(m)

Python: import math

def main():
    while True:
        e = int(input())
        if e == 0:
            break

        p = 0
        cs = list(reversed(range(math.floor(e**(1/3))+1)))
        bs = list(reversed(range(math.floor(e**(1/2))+1)))
        for c in cs:
            for b in bs:
                if c**3+b**2<e and c**3+b**2>p:
                    r = c+b
                    p = c**3+b**2
                if c**3+b**2<p:
                    break
        print(r+e-p)

main()

Python: while(True):
  e = int(input())
  if e == 0:
    quit()
  ans = e
  for i in range(0,int(e ** (1/3))+1):
      for j in range(0,int((e - i ** 3)**0.5)+1):
          k = e - i ** 3 - j ** 2 + i + j
          if k < ans:
              ans = k
  print(ans)

C++: //AOJ 2012
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<functional>
#include<string>
#include<cstring>
#include<cmath>
#include<sstream>
using namespace std;
typedef long long ll;
int  main()
{
	ll e,x,y,z,ans;
	ll ansz,ansy,ansx;
	while(cin>>e,e)
	{
		ansx=1000000000;
		for(z=100;z>=0;z--)
		{
			for(y=1000;y>=0;y--)
			{
				x=e-z*z*z-y*y;
				if(ansx>x&&x>=0)
				{
					ansx=x;
					ansy=y;
					ansz=z;
				}
			}
		}
	cout<<ansx+ansy+ansz<<endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

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

using namespace std;

#define min(a, b) ((a) < (b)? (a):(b))
#define max(a, b) ((a) > (b)? (a):(b))
#define rep(i, n) REP(i, 0, (n))
#define REP(i, a, n) for(int i=(a); i<(n); i++)

int main() {
    while(1) {
        int e; cin >> e;
        if(e == 0) break;
        int ans = 1000000;;
        rep(z, pow(e, 1.0/3.0)+1) {
            rep(y, sqrt(e)+1) {
                int x = e - y*y - z*z*z;
                if(x < 0) break;
                ans = min(ans, x + y + z); 
            }
        }
        cout << ans << endl;
    }
}

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=round(pow((double)e,1.0/2.0)),z=round(pow((double)e,1.0/3.0)),m=x;

      for(int i=z;i>=0;i--){
        for(int j=0;j<=y;j++){
          for(int k=0;k<=x;k++){
            if(k+round(pow((double)j, 2.0))+round(pow((double)i, 3.0))==e&&m>i+j+k){
              m=i+j+k;
              break;
            }else if(i+round(pow((double)j, 2.0))+round(pow((double)k, 3.0))>e){
              break;
            }
          }
          if(i+round(pow((double)j, 2.0))>e) break;
          if(m!=x) break;
        }
        if(m!=x) break;
      }
      cout << m << endl;
    }
  }

  return 0;
}