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 <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

signed main(void)
{
  while(true) {
    long double q;
    cin >> q;
    if(q == -1) break;
    long double a = q/2.0;
    while(abs(a*a*a-q) >= 0.00001*q) {
      a = a-(a*a*a-q)/(3*a*a);
    }
    cout << fixed << setprecision(15) << a << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

int main(){
    double tmp[20][2];
    int cnt=0;
    int n;
    for (;;) {
        scanf("%d",&n);
        if (n==-1) break;
        double ans=1.0*n/2.0;
        while (abs(ans*ans*ans-n)>=0.00001*n) ans-=(ans*ans*ans-n)/(3*ans*ans);
        printf("%.8lf\n",ans);
    }
    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 <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

void solve(long long q) {
    double x = q / 2;
    while(max(x*x*x - q, -(x*x*x - q)) >= 0.00001*q) {
        x = 1.0 * x - (x*x*x - q) / (3 * x*x);
    }
    printf("%.15f\n", x);
}

int main() {
    long long q;
    while(~scanf("%lld",&q) && ~q) solve(q);
}

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(pow(x,3.0)-q)< 0.00001*q)
				break;
			x =x-(pow(x,3.0)-q)/(3*pow(x,2.0));
		}
		printf("%,7f\n",x);
	}

	return 0;
}

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

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	double x, q;
	while(cin >> q)
	{
		if(q == -1)	
			break;
		x = q / 2.0;
		while (std::abs(x*x*x-q) >= 0.00001*q)
			x -= (x*x*x - q) / (3*x*x);
		printf("%f\n", x);
	}
}

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

using namespace std;

double ThirdRoot(double q){
	double ret = q/2;
	while( true ){
		if( fabs(pow(ret,3.0) - q) < 0.00001*q ) break;
		ret = ret - ((pow(ret,3.0) - q) / (3 * pow(ret, 2.0)));
	}
	return ret;
}

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

		printf("%lf\n", ThirdRoot((double)q));
	}
	return 0;
}

C++: #include <stdio.h>
#define EPS 0.00001

int main(void) {
	int n,i;
	double x;
	double x2;
	double x3;
	while (scanf("%d", &n), n!=-1) {
		x = (double)n / 2;
		i = 0;
		x3 = x * x * x;
		while (!(-EPS*(double)n < x3-(double)n && x3-(double)n < EPS*(double)n)){
			x2 = x * x;
			x3 = x * x * x;
			x = x - ((x3 - n) / (3 * x2));
			i++;
		}
		printf("%f\n", x);
	}
	return 0;
}

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

C++: #include<iostream>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int x;

  while(1){
    cin>>x;
    if(x<0)break;
    double a,b;
    b=x/2;

    while(2){
      a=b-(b*b*b-x)/(3*b*b);
      if(abs(a*a*a-x)<0.00001*x)break;
      b=a;
    }
    cout<<a<<endl;
  }
}

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

int main() {
    int n;
    while (true) {
        scanf("%d", &n);
        if (n == -1) break;
        printf("%.6f\n", pow(n, 1.0 / 3));
    }
    return 0;
}

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

using std::cin;
using std::cout;
using std::endl;
using std::ios_base;
using std::setiosflags;
using std::setprecision;

double third_root(double q,int n) {
	double x = q/2.0;
	for (int i = 0;i != n;++i) {
		x = x - (x*x*x - q)/(3*x*x);
	}
	return x;
}

int main() {
	int q;
	while (cin >> q && ~q) {
		cout << setiosflags(ios_base::fixed) << setprecision(6) << third_root((double)q,100000) << endl;
	}
}

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

int main()
{
  long long x;
  while (1){
    cin >> x;
    if (x < 0){
      break;
    }
    printf("%.10f\n", cbrt(x));
}
  return 0;
}