Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtof ...
func Sliceconvtof() []float64 {
	strs := strings.Split(sc.Text(), " ")

	var flts []float64
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		xf := float64(x)
		flts = append(flts, xf)
	}

	return flts
}

//ThirdRoot .
func ThirdRoot(f float64) float64 {
	xn := f / 2
	var dmt float64

	for {
		dmt = math.Pow(xn, 3) - f
		if math.Abs(dmt) < 0.00001*f {
			break
		}

		xn = xn - (dmt / (3 * math.Pow(xn, 2)))
	}

	return xn
}

func main() {

	for sc.Scan() {
		i := Sliceconvtof()
		if i[0] == -1.0 {
			break
		}
		fmt.Printf("%6f\n", ThirdRoot(i[0]))
	}

}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> P;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
double f(double x,double q){
  return (x-(x*x*x-q)/(3*x*x));
}
double newton(double x,double q){
  double nx = f(x,q);
  if(abs(nx*nx*nx-q)<0.00001*q) return nx;
  else return (newton(nx,q));
}
int main(void){
  int q;
  while(cin>>q){
    if(q==-1) break;
    //printf("%lf\n",newton(q/2,q));
    printf("%lf\n",pow(q,(double)1/3));
  }
  return 0;
}

C++: #include<stdio.h>
double abs(double A){
	return A<0.0?-A:A;
}
int main(){
	int a;
	while(scanf("%d",&a),~a){
		double p=(double)a/2.0;
		while(1){
			p=p-((p*p*p)-(double)a)/(3.0*p*p);
			if(abs(p*p*p-(double)a)<(double)a*0.00001)break;
			//printf("%.6lf\n",p);
		}
		printf("%.6lf\n",p);
	}
}

C++: #include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
int main(void)
{
    int a;
    while(cin>>a)
     {
        if(a==-1)break;
        double q = (double)a;
        double x = q/2;
        while(abs(x*x*x-q)>=0.00001*q)
         {    
            double y = x-(x*x*x-q)/(3*x*x);
            x = y;
        }
      printf(%.6lf\n,x);
    }
    return 0;
}

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

int main() {
	double q;
	while (cin >> q, q >= 0.0) {
		double x = q / 2.;
		while (fabs(x * x * x - q) >= 0.00001 * q) {
			x = x - (x * x * x - q) / (3 * x * x);
		}
		printf("%.6lf\n", x);
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

signed main() {
	double q;
	while (cin >> q, q != -1) {
		double x = q / 2;
		while (abs(x*x*x - q) >= (1e-5)*q) {
			x = (x - (x*x*x - q) / (3 * x*x));
		}
		cout << fixed <<  x << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

#define INF 1000000000

typedef double Real;
#define EPS 1e-11
#define EQ(x) (-EPS<x && x<EPS)
typedef complex<Real> P;
Real dot(P a,P b){return real(conj(a)*b);}
Real cross(P a,P b){return imag(conj(a)*b);}

int main(){
  cout.precision(12);
  while(true){
    Real x;
    cin>>x;
    if(x==-1)break;
    Real a = x/2;
    while(abs(a*a*a-x)>1e-3){
      a = a-(a*a*a-x)/(3*a*a);
    }
    cout<<fixed<<a<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <stack>
#include <string>
#include <queue>
#include <algorithm>
#include <functional>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string.h>

using namespace std;
static const double EPS = 1e-6;


void solve()
{
	int q;
	while (cin >> q, q != -1)
	{
		double left = 0.0;
		double right = 1 << 24;
		for (int i = 0; i < 100; ++i)
		{
			double mid = (left + right) / 2;
			if (q - mid * mid * mid > EPS)
			{
				left = mid;
			}
			else
			{
				right = mid - 0.0001;
			}
		}
		printf("%.8f\n", left);
	}
}

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double n;
  while(cin>>n,n!=-1){
    double q=n;
    n/=2;
    while(fabs(n*n*n-q)>=0.00001*q)
      n=n-(n*n*n-q)/(3*n*n);
    printf("%.6f\n",n);
  }
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

int main() {
	double q;
	while(cin >> q, q != -1) { 
		double x1, x2;
		x1 = q/2;
		
		while(!(abs(x1*x1*x1-q) < 0.00001*q)) {
			x2 = x1 - ((x1*x1*x1-q) / (3*x1*x1));
			x1 = x2;
		}

		printf("%.6f\n", x1);
	}
}

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

double ans(int q,long double x){
	x=x-(x*x*x-q)/(3*x*x);
	if((x*x*x-double(q)<0.00001*double(q))&&(x*x*x-double(q)>-0.00001*double(q))){
		return x;
	}else{
		return ans(q,x);
	}
	
}


int main(){
	int q;
	long double x;
	while(scanf("%d",&q),q!=-1){
		x=ans(q,double(q)/2);
		cout<<x<<endl;
	}
}

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

using namespace std;

int in;
long double judge;

int getketa(int in){
  int sum = 0;
  while(in){
    in/=10;
    sum++;
  }
  return sum;
}

void make(){
  int keta = getketa(in);
  judge = in;
  for(int i = 0; i < 5+keta; i++) judge *= 0.1;
  judge += 0.00001;
  // cout << judge << endl;
}
int main(){

  while(cin >> in){
    if(in == -1) break;
    make();
    long double x = in/2;
    while(1){
      x =2*x/3+in/x/x/3;
      if(fabs(x*x*x - in) < judge) break;
    }
    printf("%8Lf\n",x);
  }
  return 0;
}

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


int main() {
	long long int q;
	double x;
	while(1){
		cin >> q;
		if(q==-1) break;
		double x = (double)q/2.0;
		while(fabs(x*x*x-q)>0.00001*(double)q){
			x = x-(x*x*x-q)/(3*x*x);
		}
		printf("%.6f\n",x);
	}
	return 0;
}

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

int main()
{
  int q;
  while (~scanf("%d", &q)) {
    if (q == -1)
      break;

    double x = q / 2.0;
    while (std::abs(x*x*x-q) >= 0.00001*q)
      x = x - ((x*x*x-q) / (3*x*x));
    printf("%f\n", x);
  }
  return 0;
}