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<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
long long int in;
while(cin>>in,in+1){
double x=in/2;
while(x*x*x-in>0.00001*in||x*x*x-in<-0.00001*in)
x-=(x*x*x-in)/(3*x*x);
if(in!=1)
printf("%.6f\n",x);
else
cout<<1<<endl;
}
}

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

int main(){

    for(double q;cin>>q;){
        if(q<0)break;
        double x = q / 2;
        while(1){
            if(abs(x*x*x-q) < 0.00001 * q)break;
            double xx = x - (x * x * x - q) / (3 * x * x);
            x = xx;
        }
        printf("%.10f\n", x);
    }

    return 0;
}

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

using namespace std;

int main()
{
  double x,q;
  for(;cin>>q,q!=-1;)
    {
      x=q/2;
      for(;abs(x*x*x-q)>=0.00001*q;)
	{
	  x=x-((x*x*x-q)/(3*x*x)); 
	}
      cout<<x<<endl;
      
    }
}

C++: #include<bits//stdc++.h>
using namespace std;
int main(){
	int a;
	while(true){
		cin>>a;
		if(a==-1) {break;}
		double x1=a/2,x2;
		int i=1;
		while(true){  
				x2=x1-(x1*x1*x1-a)/(3*x1*x1);
				if(abs(x2*x2*x2-a)<0.00001*a) 
				{
					cout<<x2<<endl;
					break;
				}
				x1=x2-(x2*x2*x2-a)/(3*x2*x2);
				if(abs(x1*x1*x1-a)<0.00001*a) 
				{
					cout<<x1<<endl;
					break;
			    }
			i++; 
		}

	}
			return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdio>
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 nx = x-(x*x*x-q)/(3*x*x);
			x = nx;
		}
		printf("%.6lf\n",x);
	}
	return 0;
}

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

int main() {
	double q, x;
	while (cin >> q&&q!=-1) {
		x = q / 2;
		while (abs((x*x*x) - q) > 0.00001*q) {
		x=x - (((x*x*x) - q) / (3 * x*x));
		}
		cout << fixed << setprecision(7) << x << endl;
	}
	return 0;
}

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

bool finish(double q, double x) {
  return abs(x*x*x - q) < 0.00001 * q;
}

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

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

double q;
double f(double x) {
    return x - ((x*x*x - q) / (3 * x * x));
}

int main() {
    while (cin >> q, q != -1){
        double x = q/2;
        while (fabs(x*x*x - q) > 1e-5 * q) {
            x = f(x);
        }
        printf("%.10lf\n", x);
    }
}

C++: #include<bits//stdc++.h>
using namespace std;
int main(){
	int a;
	while(true){
		cin>>a;
		if(a==-1) {break;}
		double x1=a/2,x2;
		int i=1;
		while(true){  
				x2=x1-(x1*x1*x1-a)/(3*x1*x1);
				if(abs(x2*x2*x2-a)<0.00001*a) 
				{
					cout<<x2<<endl;
					break;
				}
				x1=x2-(x2*x2*x2-a)/(3*x2*x2);
				if(abs(x1*x1*x1-a)<0.00001*a) 
				{
					cout<<x1<<endl;
					break;
			    }
			i++; 
		}

	}
}

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;
    while(abs(a*a*a-x)>EPS){
      a = a-(a*a*a-x)/(3*a*a);
    }
    cout<<fixed<<a<<endl;;
  }
  return 0;
}

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("%Lf\n",x);
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <bitset>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif


int main(int argc, char **argv){
	int q;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	while(ifs >> q){
#else
	while(std::cin >> q){
#endif
		if(q == -1){ break; }
		double pre_x = 0.5 * q;
		double cur_x = 0;
		double cr = 0.00001 * q;

		while(fabs(pow(cur_x, 3) - q) >= cr){
			double pre_x2 = pre_x * pre_x;
			double pre_x3 = pre_x2 * pre_x;

			cur_x = pre_x - (pre_x3 - q) / (3 * pre_x2);
			pre_x = cur_x;
		}
		printf("%.6lf\n", cur_x);
	}


 
#if INPUT_FROM_FILE
	//fclose(fp);
#endif
    return 0;
}

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,20000){
			x = x-(x*x*x-q)/(3*x*x);
		}
		
		printf("%.9lf\n",x);
	}
	
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
const static double EPS = 1e-5;

double cube( double x ) {
  return x * x * x;
}

int main() {

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

    double x;
    for(
        x = q / 2.0;
        fabs( cube( x ) - q ) >= q * EPS;
        x = x - ( cube( x ) - q ) / ( 3 * x * x )
       );

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

  }
  return EXIT_SUCCESS;
}

C++: #include "bits/stdc++.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<iostream>
#include<math.h>
#include<stdio.h>

using namespace std;

int main(void)
{
	double q;
	while(1){
		cin>>q;
		if(q==-1) break;
		double x=q/2;
		while(1){
			x=x-((x*x*x-q)/(3*x*x));
			if(fabs(x*x*x-q)<0.00001*q) break;
		}
		printf("%.6lf\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.000001*q){
			x=x-(x*x*x-q)/(3.0*x*x);
		}
		cout.precision(6);
		cout << fixed << x << endl;
	}
	return 0;
}