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>
#define eps 0.000001
double q;

double fabs(double a){
	if(a<0)return -a;
	return a;
}

int main(void){
	while(1){
		scanf("%lf",&q);
		if(q==-1)break;
		double x=q/2;
		while(fabs(x*x*x-q)>=eps*q){
			x=x-(x*x*x-q)/(3*x*x);
		}
		printf("%0.10f\n",x);
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(void){
    double a,x;
    while(cin>>a,a!=-1){
        x=a*0.5;
        while(fabs(x*x*x-a)>=0.00001*a)x=x-(x*x*x-a)/(3*x*x);
        printf("%.6lf\n",x);
    }
    return 0;
}

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

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

C++: #include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main( void )
{
	int qi;
	while ( cin >> qi && qi != -1 )
	{
		long double q = (long double)qi;
		long double x = q/2.0;
		while ( fabs( x*x*x - q ) >= 0.00001 * q )
		{
			long double next_x = x - (x*x*x-q) / (3 * x * x);
			x = next_x;
		}
		cout.setf( ios::fixed, ios::floatfield );
		cout << setprecision( 6 );
		cout << x << endl;
	}
}

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

int main()
{
    int q;
    while(cin >> q)
    {
        if(q==-1)break;
        double qz = (double)q;
        double x=qz/2;
        double e;
        while(1)
        {
            e = x*x*x-qz;
            if(fabs(e)*100000 < qz) break;
            x= x-e/(3*x*x);
        }
        printf("%.6f\n",x);
    }
    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 long 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-9){
      a = a-(a*a*a-x)/(3*a*a);
    }
    cout<<fixed<<a<<endl;
  }
  return 0;
}

C++: #define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>

using namespace std;

int main(){
	int n;
	while(cin>>n,~n){
		if(n == 0){ puts("0"); continue; }
		double a,b = n/2.0;
		do{
			a = b;
			b = a - (a*a*a-n)/(3*a*a);
		}while(abs(b*b*b-n) >= 0.00001*n);

		printf("%.15f\n",b);
	}
    return 0;
}

C++: #include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<cstdio>
typedef unsigned long long ull;
#define rep(i,a) for(int i=0;i<a;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
const double eps = 1e-5;
const double pi = acos(-1);
const double inf = (int)1e5;

int main(void){
  double N;
  while(cin>>N,N!=-1){
    double q =1.0*N/2;
    int i = 0;
    while(abs(pow(q,3)-N)>eps&&i<10000){
      i++;
      //printf("%.10f\n",q);
      q=q-(pow(q,3)-N)/(3*pow(q,2));
    }
    printf("%.6f\n",q);
  }
}

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

int main()
{
 double x;
 int q;
 while(1)
 {
   cin>>q;
   x=q/2;
  if(q==-1)
   break;
  while(fabs (x*x*x-q)>=0.00001*q)
   x=x-(x*x*x-q)/(3*x*x);
  cout<<setprecision(6)<<setiosflags(ios::fixed); 
	  cout<<x<<endl;
  
  
 
 }
return 0;
}

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

int main(){
    long long n;
    double prev=0,now=0;
    while(cin>>n){
        if(n==-1)break;
        now = n/2.0;
        while(!(abs(pow(now,3) - n ) < (0.00001 * n))){
            prev = now;
            now = prev - (pow(prev, 3) - n)/(3*pow(prev,2));
        }
        printf("%.6f\n", now);
    }
    
}

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

/** Problem0080 : Third Root **/
int main()
{
	double x, oldX, in;
	
	while (cin >> in) {
		if (in == -1) break;
		
		oldX = in/2.0;
		for (;;) {
			x = oldX - (oldX*oldX*oldX-in)/(3*oldX*oldX);
			
			if (x*x*x > in) {
				if (x*x*x - in < 0.00001*in)
					break;
				else
					oldX = x;
			} else {
				if (in - x*x*x < 0.00001*in)
					break;
				else
					oldX = x;
			}
		}
		printf("%.6lf\n", x);
	}
	
	return 0;
}

C++: #include <cstdio>
#include <cmath>
int main()
{
float x,q;
while(1){
scanf("%f",&q);
if(q==-1){
break;
}
x=q/2;
while(fabs(x*x*x-q)>0.00001*q){
x=x-(x*x*x-q)/(3*x*x);
}
printf("%.6f\n",x);
}
return 0;
}

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

const double EPS = 1e-5;

double q;

int main()
{
	while( std::cin >> q, q != -1 )
	{
		double prv = q / 2.0, crt;

		do
		{
			crt = prv - ( pow( prv, 3.0 ) - q ) / ( 3 * pow( prv, 2.0 ) );
			prv = crt;
		}while( abs( pow( crt, 3.0 ) - q ) >= EPS * q );

		std::cout << std::setprecision( 7 ) << crt << std::endl;
	}

	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>

using namespace std;

int main(){
	int n;
	while(cin>>n,~n){
		double a,b = n/2.0;
		do{
			a = b;
			b = a - (a*a*a-n)/(3*a*a);
		}while(abs(b*b*b-n) >= 0.00001*n);

		printf("%lf\n",b);
	}
    return 0;
}