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 <iostream>
#include "stdio.h"
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 <stdio.h>
#include <math.h>
int main(void){
    int q; 
    while(scanf("%d", &q)!= EOF) { 
        double x;       
        x=q/2;    
        if(q == -1)break;
            double xx;       
            while((fabs(x*x*x-q))>=(0.00001*q)){   
                xx=x-((x*x*x-q)/(3*x*x));      
                x=xx;          
            }          
            printf("%.6f\n",xx);     
            }    
                
        return 0; 
}

C++: #include <stdio.h>
#include <math.h>

#define ABS(x) ((x) < 0 ? -1 * x : x)

double q;

double tr(double x){
  if(ABS(pow(x, 3) - q) < 0.00001 * q) return x;
  return tr(x - ((pow(x, 3) - q) / (3 * pow(x, 2))));
}

int main(){
  while(scanf("%lf", &q) && q != -1)
    printf("%.6f\n", tr(q / 2));
  return 0;
}

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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

const int    INF = 1000000000;
const ll     MOD = 1000000007LL;
const double EPS = 1E-5;

double q;
double prev;

template<typename T> T add(T x, T y){ if(abs(x+y) < EPS*q*(abs(x)+abs(y))) return 0; return x + y; }
template<typename T> inline bool semieq(T x, T y){ return abs(x - y) < EPS*q; }
template<typename T> inline bool semige(T x, T y){ return x - y > -EPS; }
template<typename T> inline bool semile(T x, T y){ return y - x > -EPS; }

inline double next(double x, double q){ return x - ((x * x * x - q) / ( 3 * x * x)); }

int main()
{
  while((cin >> q) && q > 0.0){
    double res = q / 2.0;
    while(!semieq(res, next(res, q))) res = next(res, q);
    printf("%.15f\n", res);
  }

  return 0;
}

C++: #include <stdio.h>
#define ABS(X) ((X)<0?-(X):(X))

int main(){
    int q;
    double x;
    
    while(scanf("%d",&q)){
        if (q==-1) break;
        for (x=q/2.0; ABS(x*x*x-q) >= 0.00001*q; x-=(x*x*x-q)/(3*x*x));
        printf("%f\n", x);
    }
    
    return 0;
}

C++: #include <bits/stdc++.h>
#define range(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) range(i,0,n)
using namespace std;

int main(void){
	int q;
	while(cin >> q){
		if(q==-1) break;
		double x=1.0*q/2.0;
		while(abs(x*x*x-q)>0.00001*q){
			x=x-(x*x*x-q)/(3.0*x*x);
		}
		cout.precision(6);
		cout << fixed << x << endl;
	}
	return 0;
}

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

using namespace std;

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

		double x = q / 2.0;

		while ( q * 0.00001 < abs( pow( x, 3 ) - q ) )
		{
			x -= ( ( pow( x, 3 ) - q ) / ( 3 * pow( x, 2 ) ) );
		}

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

	return 0;
}

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

using namespace std;

long long 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 = 0.1 * in;
  judge++;
  //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)*10*10*10*10*10 < judge) break;
    }
    printf("%.6Lf\n",x);
  }
  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 <stdio.h>
#include <math.h>
int main(void){
	int q;
	while(scanf("%d", &q))
	{      
		if(q==-1) break;
		double x;
		x=q/2;
		while(fabs(x*x*x-q)>0.00001*(double)q){
			x=x-(x*x*x-q)/(3*x*x);
		}
		printf("%.6f\n",x);
	}
}

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

int main()
{
    int q;
    while (cin >> q && q != -1) {
        double x1 = q / 2.0;
        while (true) {
            if (abs(x1*x1*x1 - q) < 0.00001*q) {
                break;
            }
            double t1 = 3*x1*x1;
            x1 = x1 - (x1 / 3.0 - q / t1);
        }
        printf("%.06lf", x1);
        cout << endl;
    }
    return 0;
}

C++: #include <stdio.h>
#include <math.h>
int main(void){
    int q; 
    while(scanf("%d", &q)!= EOF) { 
        double x;       
        x=q/2;      
        if(q!=-1)  {       
            double xx;       
            while((fabs(x*x*x-q))>(0.00001*q)){   
                xx=x-((x*x*x-q)/(3*x*x));      
                x=xx;          
                }          
                printf("%.6f\n",xx);     
                }    
                }
                return 0; 
}

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

using namespace std;

long double thrt(long double q){
  long double x=q/2.0;
  while(abs(x*x*x-q)>=0.00001*q){
    x-=(x*x*x-q)/(3.0*x*x);
  }
  return x;
}

int main(){
  long double q;
  while(cin>>q&&(q!=-1)){
    cout<<setprecision(10)<<thrt(q)<<endl;
  }

}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<functional>
#include<stack>
#include<list>
#include<set>
#include<deque>
#include<climits>
using namespace std;

double abso(double n){
	if(n<0) return n*=-1;
	return n;
}

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

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>

using namespace std;

int main(){

	int q;
	while(cin>>q&&q!=-1){
		double x=(double)q/2;
		while(abs(x*x*x-q)>=0.00001*q){
			x = x - (x*x*x-q)/(3*x*x);
		}
		printf("%.10f\n",x);
	}

	return 0;
}