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 <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
int main()
{
	double x;
	int q;
	while(1)
	{
		cin >> q;
		if(q==-1)break;
		x=q/2.0;
		while(fabs(x*x*x-q)>=0.00001*q)
		{
			x-=((x*x*x-q)/(3*x*x));
		}
		printf("%.6f\n",x);
	}
	return 0;
}

C++: #include<stdio.h> 
    double zenka(double q){   
    double x=q/2;  
    while(x*x*x-q>=0.00001*q || x*x*x-q<=-0.00001*q)    {  
        x=x-((x*x*x)-q)/(3*x*x); 
        }   
        return x;
        
    }
    int main(void){
        int q;     
        while(1)    {     
            scanf("%d",&q);  
            if(q==-1) 
            break;    
            else      
            {         
                printf("%.7f\n",zenka(q));     
                }  
                }     
    return 0;
        
    }

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

using namespace std;

int main(){
        int q;
        cin >> q;
        while(q > 0){ 
                double x = q/2;
                while((x*x*x-q)*10000 >= q || (x*x*x-q)*10000 <= -q){
                        x -= (x*x*x-q)/(3*x*x);
                }   
                printf("%.6f\n",x);
                cin >> q;
        }   
}

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(;abs((x*x*x)-q)>=0.000001*q;)
	{
	  x=x-(((x*x*x)-q)/(3*x*x)); 
	}
      cout<<setprecision(7)<<x<<endl;
      
    }
}

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

using namespace std;

int main(){
        int q;
        cin >> q;
        while(q > 0){ 
                double x = q/2;
                while((x*x*x-q)*10000 >= q || (x*x*x-q)*10000 <= -q){
                        x -= (x*x*x-q)/(3*x*x);
                }   
                cout << x << endl;
                cin >> q;
        }   
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
using namespace std;

const double EPS = 1e-9;

double tr(double xn, double q){
	double xn2 = xn*xn;
	double xn3 = xn2*xn;
	if(abs(xn3 - q) < 0.00001*q + EPS){
		return xn;
	}
	return tr(xn-(xn3-q)/(3.0*xn2), q);
}

int main(){
	int q;
	while(cin >> q, q != -1){
		cout.precision(8);
		cout << tr(q/2.0, q) << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <sstream>
#include <fstream>
//#include <tuple>
#include <set>
#include <string.h>
#include <functional>

#define X first
#define Y second
#define MP make_pair
//#define MT make_tuple
#define REP(i, a, n) for(int (i) = (a); (i) < (n); ++(i))
#define FOR(i, n) REP(i, 0, n)
typedef long long ll;
using namespace std;
const int MAX = 500;

template<class T, class U>
void convert(T &t, U &u)
{
	stringstream ss;
	ss << t;
	ss >> u;
}

int main()
{
	ll q;
	while( cin >> q ){
		if( q == -1 ) break;
		double x = q / 2;
		while(  x * x * x - q >= 0.000010 * q){
			x = x - (x * x * x - q) / ( 3 * x * x );
		}
		cout << x << endl;
	}
	return 0;
}

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

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

int main(void){
	double q;

	while(cin>>q && q!=-1){
		double x = q / 2;

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

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

	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
int main(){
  double q,x;
  while(cin>>q,q!=-1){
    x=q/2;
    while(fabs(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++: #define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF         1e9
#define INFLL       1e18
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP(n)     cout << fixed << setprecision(n)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

signed main()
{
	ll q;
	while ((q = in()) != -1) {
		double x = q / 2.0;
		while (abs(x * x * x - q) >= 0.00001 * q) {
			x -= (x * x * x - q) / (3 * x * x);
		}
		SETP(10);
		cout << x << endl;
	}
}

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

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	double x,q;
	while(q=in(),q>0){
		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);
	}
	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("%.7f\n", x);
	}
}