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 <stdio.h>
#include <cmath>
#include <algorithm>

using namespace std;


int main(){

    double q,tmp,next,limit;

    while(true){
    	scanf("%lf",&q);
    	if(q == -1)break;

    	limit = 0.00001*q;
    	tmp = q/2;
    	next = q/2;

    	while(fabs(next*next*next-q) >= limit){
    		tmp = next;
    		next = tmp - (tmp*tmp*tmp-q)/(3*tmp*tmp);
    	}

    	printf("%.6lf\n",next);

    }

    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
int in;
while(cin>>in,in+1){
double x=in/2;
while(x*x*x-in>0.000000001*in||x*x*x-in<-0.000000001*in)
x-=(x*x*x-in)/(3*x*x);
printf("%.9f\n",x);
}
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>
 
using namespace std;
 
#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

int main(){
	
	int a;
	while(cin>>a){
		if(a==-1)break;
		
		double q = a;
		double x = q/2;
		rep(i,200){
			x = x-(x*x*x-q)/(3*x*x);
		}
		
		printf("%.9lf\n",x);
	}
	
}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main(){
  double q;
  while(cin >> q && q != -1){
    double x = q / 2;
    while(true){
      if(fabs(x * x * x - q) < 0.00001 * q) break;
      x -= (x * x * x - q)/(x * x * 3);
    }
    cout << fixed << setprecision(7) << x << endl;
  }
}

C++: #include <iostream>
#include <iomanip>
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;
			}
		}
		cout << setprecision(7) << x << endl;
	}
	
	return 0;
}

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

int main(void){
	int q;

	while(scanf("%d", &q)){
		if(q == -1) break;
		double x = 0;
		x = q/2;
		while(x*x*x - q >= 0.00001*q){
			x = x - (x*x*x - q) / (3*x*x);
		}
		printf("%.6f\n", x);
	}


	return 0;
}

C++: #include <stdio.h>
#include <math.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    for (;;) {
        double q;
        scanf("%lf", &q);
        if (q == -1) return 0;
        double 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);
    }
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
double ans(int q,double x){
x=x-(x*x*x-q)/(3*x*x);
if((x*x*x-double(q)<0.000001*double(q))&&(x*x*x-double(q)>-0.000001*double(q))){
return x;
}else{
return ans(q,x);
}
}
int main(){
int q;
double x;
while(scanf("%d",&q),q!=-1){
x=ans(q,double(q)/2);
printf("%lf\n",x);
}
}

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

double thirdRoot(double x, double q){
	double next_x;
	if (fabs(x*x*x - q) < 0.00001*q) {
		return x;
	}else {
		next_x = x - ((x*x*x-q) / (3.0*x*x));
		return thirdRoot(next_x, q);
	}
}

int main(){
	double n;

	while (cin >> n) {
		if (n == -1) {
			break;
		}
		cout << fixed << setprecision(6)<< thirdRoot(n/2.0, n) << endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<cmath>
int main(){
	int q;float x;
	for(;scanf("%d",&q),~q;printf("%f\n",x))
		for(x=q/2.;fabs(x*x*x-q)>1e-5*q;x-=(x*x*x-q)/(3*x*x));
}

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

int main(){
    while(1){
	double q;
	cin >> q;
	if(q == -1)return 0;
	double a = q / 2;
	for(int i = 0;i < 100000;i++){
	    a = a - (a*a*a - q)/(3*a*a);
	}
	printf("%.9lf\n", a);
    }
}

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

constexpr double EPS = 0.00001;

int main() {
	cout.precision(10);
	cout.setf(ios::fixed);

	for(int q; cin >> q && q != -1;) {
		double x = q / 2.0;

		while(abs(x * x * x - q) >= EPS * q) {
			x -= ((x * x * x) - q) / (3 * x * x);
		}

		cout << x << endl;
	}

	return EXIT_SUCCESS;
}

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

using namespace std;

typedef long long int ll;

double ret(ll q) {
	double x = q / 2., th = 0.00001 * q;
	do {
		double next = x / 3 * 2 + q / (3 * x * x);
		x = next;
	} while(abs(pow(x, 3) - q) > th);
	return x;
}

int main() {
	ll x;
	while(cin >> x, x != -1) {
		cout << fixed << setprecision(6) << ret(x) << endl;
	}
	return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,b,n) for(int i=b;i<n;i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int q;
	while(1){
		cin>>q;
		if(q==-1||cin.eof())break;
		double x=q/2;
		while(true){
			if(fabs(x*x*x-q)< 0.00001*q)
				break;
			x =x-(x*x*x-q)/(3*x*x);
		}
		printf("%,6f\n",x);
	}

	return 0;
}

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

using namespace std;

int main(void){

  int q;
  while( cin >> q ){
    if( q == -1 )break;

    double x =  q / 2;
    while(1){
      if( abs(x*x*x - q) < 0.00001*q )break;
      x = x - ( x*x*x - q ) / ( 3*x*x );
    }
    printf("%.6f", x);
    cout << endl;
  }
  return 0;
}

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

int main(){
	double x, q, y;
	while(scanf("%lf", &q), q >= 0.0){
		x = 0.5 * q;
		while(1){
			y = x * x * x - q;
			if(abs(y) < 1e-5 * q){
				break;
			}
			x -= y / (3.0 * x * x);
		}
		printf("%.5f\n", x);
	}
}

C++: #include <iostream>

#define abs(x) ( x>0.000000 ? x : -x )

double third_root( double x, double q) {
	double x2 = (2.0*x + q/(x*x))/3.0; //x - ( x - q/x*x) / 3.0;
	if( abs( x2*x2*x2 - q )<0.00001*q ) return x2;
	return third_root( x2, q);
}

int main() {
	int n;
	while(1) {
		std::cin >> n;
		if(n==-1) break;
		std::cout << third_root( (double)n / 2.0, (double)n ) << std::endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
  int a;

  while(cin >> a)
  {
    if(a == -1) { goto Exit; }

    cout << setprecision(15) << pow(a, 1.0 / 3.0) << endl;
  }

Exit:;

  return 0;
}

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;
        double e;
        while(1)
        {
            e = x*x*x-qz;
            x= x-e/(3*x*x);
            if(fabs(e)*200000 < qz) break;
        }
        printf("%.6f\n",x);
    }
    

    return 0;
}