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 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; }
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<iostream>
#include <cmath>
#include <iomanip>

using namespace std;

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

C++: #include <iostream>
#include <cmath>
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 <bits/stdc++.h>
#define SIZE 300005
#define MOD 1000000007LL
#define INF 1 << 30
#define LLINF 1LL << 60
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define FORALL(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define FOREACH(i,c) for(auto (i) : (c))
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
typedef long long ll;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
typedef complex<double> dcomplex;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cout<<a[i]<<((i==a.size()-1)?"\n":" ");}}
ll gcd(ll a,ll b){int c=max(a,b);int d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
ll lcm(ll a,ll b){return a==0||b==0?0:a*b/gcd(a,b);}

void solve(const double q)
{
  double a = q*0.5;
  while(fabs(a*a*a-q)>=1e-5) a -= (a*a*a-q)/(3*a*a);
  printf("%lf\n",a);
}

int main()
{
  double q;
  while(cin>>q,q>0) solve(q);
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	int q;
	while(1){
		cin>>q;
		if(q==-1) break;
		double x=(double)q/2;
		while(1){
			x=x-(double)(x*x*x-q)/(3*x*x);
			if(abs(x*x*x-q)<1e-5*q) break;
		}
		printf("%.7lf\n",x);
	}
}

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

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( 8 ) << crt << std::endl;
	}

	return 0;
}

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

int main() {

  long long int in;

  while( true ) {

    cin >> in;

    if ( in == -1 ) break;

    double x = 0.50 * in;

    while( abs( x * x * x - in ) >= 0.00001 * in ) {

      x = x - ( x * x * x - in ) / ( x * x * 3 );

    }

    cout << fixed << setprecision(8) << x << endl;

  }

  return 0;

}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

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

C++: 
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0080

#include <algorithm>
#include <iostream>
#include <vector>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

using namespace std;

//テ」ツδ榲」ツつッテ」ツδュテ・ツョツ堙ァツセツゥ
#define ALL(v) (v).begin(),(v).end()
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define REP(i,a,b) for(int i=(int)(a); i<(int)(b); ++i)
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define SORT(x) sort(begin(x),end(x))
#define SELECT_SORT(x, n) sort(begin(x),begin(x)+n)
#define SWAP(type, a, b) do {type tmp = a; a = b; b = tmp;} while (0)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))

//テ・ツョツ堙ヲツ閉ー
#define INF 2000000000000
#define MAX 10

//DEBUGテァツ板ィ
#define BAR() cout << "----------------------------" << endl;
#define DUMP(v) (cerr << #v << ": " << v << endl)
#define PRINT(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

double formula(double x, double q){
	return x - ( (pow(x, 3) - q) / ( 3*pow(x,2) ) );
}

int main()
{
	double q;
	double ans;
	while(cin >> q && q != -1)
	{
		ans = formula(q/2,q);
		while(true){
			if(fabs( pow(ans,3) - q ) < 0.00001*q){ break; }
			ans = formula(ans,q);
		}
		cout << ans << endl;
	}
}

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 i) {
	if (i == 1) {
		return q/2;
	}
	double x = third_root(q,i-1);
	return x - (x*x*x - q)/(3*x*x);
}

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

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));
}