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 <cstdio>
#include <cmath>
using namespace std;

#define EPS 1e-5

int main() {
  
  double q;
  while( cin >> q, q >= 0 ) {
    double x = q/2;
    while( abs( x*x*x - q ) >= EPS ) {
      x = x - ( x*x*x - q ) / ( 3*x*x );
    }
    printf("%f\n", x);
  }
  
  return 0;
}

C++: #include <cmath>
#include <iostream>
int main(){
	int q;
	while (1){
		std::cin>>q;
		if(q==-1)break;
		double x=q/2,a;
		while(1){
			a=x*x*x-q;
			if(fabs(a)<1e-5*q)break;
			x-=a/3/x/x;
		}
		std::cout<<x<<"\n";
	}
}

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

using namespace std;

int main()
{
//	cut here before submit 
//	freopen ("testcase.tr", "r", stdin );

	double q;

	while (cin >> q &&  q != -1.0 ){
		double x = q/2.;
		while (fabs (x*x*x - q) >= 0.00001*q  ){
			double y = (x*x*x - q )/(3.*x*x );
			x = x - y;
		} // end while
		printf ("%.6f\n", x );
	} // end loop
		
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-8;
int dx[4]={0,0,1,-1};
int dy[4]={-1,1,0,0};
int main(){
	double q;
	while(cin>>q,q!=-1){
		double dp[100010];
		dp[0]=q/2;
		for(int i=0;i<100;i++){
			dp[i+1]=dp[i]-(pow(dp[i],3)-q)/(3*pow(dp[i],2));
		}
		printf("%.8lf\n",dp[100]);
	}
		
}

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;
        }
       cout<<x<<endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define EPS 1e-5
using namespace std;

int main() {
	double q;
	while (cin >> q, q != -1.) {
		double x = q / 2;
		while (abs(x*x*x - q) >= EPS*q) {
			x -= (x*x*x - q) / (3 * x*x);
		}
		printf("%6lf\n", x);
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

int main(){
  int N;

  while(cin >> N, N != -1){
    printf("%.6f\n",pow(N,1./3));
  }

  return 0;
}

C++: #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;a++) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
ld abs(long double A) {
	return A<0.0 ? -A : A;
}
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    ld a = 0;
	while (true) {
		cin >> a;
		if (a == -1) { break; }
		ld x = (ld)a / (ld)2.00000000000000000000000;
		while ((ld)abs((ld)x *(ld)x * (ld)x - (ld)a) >=(ld) 0.00001*(ld)a) {
			x =(ld) x -(ld) (x * x * x - (ld)a) / (ld)((ld)3.00 * x * x);
		}
		printf("%.6lf\n", x);
	}
	return 0;
}

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

int main(){
    double x,y,q;
    while(cin>>x,q>=0.0){
        x=q/2;
        while(1){
            y=x*x*x-q;
            if(abs(y)<1e-5*q)break;
            x-=y/(3*x*x);
        }
        cout<<x<<endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1ll << 60;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

#ifdef WIN32
#define dump(x) cout << #x << " = " << (x) << "\n"
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n"
#else
#define dump(x)
#define debug(x)
#endif

int n;

void solve() {
	printf( "%f\n", pow(n, 1.0 / 3) );
}

int main() {
#ifdef WIN32
	printf( "Debug Mode\n" );
#endif
	while ( ~scanf( "%d", &n ) && ~n ) {
		solve();
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<cstdio>
typedef unsigned long long ull;
#define rep(i,a) for(int i=0;i<a;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
const double eps = 1e-8;
const double pi = acos(-1);
const double inf = (int)1e5;

int main(void){
  double N;
  while(cin>>N,N!=-1){
    double q =1.0*N/2;
    int i = 0;
    while(abs(pow(q,3)-N)>eps&&i<10000){
      i++;
      //printf("%.10f\n",q);
      q=q-(pow(q,3)-N)/(3*pow(q,2));
    }
    printf("%.6f\n",q);
  }
}

C++: #include<iostream>
#include<stdio.h>
#define EPS 0.00000001
using namespace std;
typedef long long ll;

bool eq(double x,double y){
  if(-EPS<x-y&&x-y<EPS)return true;
  else return false;
}

ll n;
double q;
double t[10000];
int main(){
  while(cin>>n){
    if(n==-1)break;
    t[1]=n/2.0;
    for(int i=2;i<10000;i++){
      t[i]=t[i-1]-(t[i-1]*t[i-1]*t[i-1]-(double)n)/(3.0*t[i-1]*t[i-1]);

      if(eq(t[i]*t[i]*t[i],n)){
	//cout<<t[i]<<endl;
	printf("%.6f\n",t[i]);
	break;
      }
    }
    
  }
}

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)>=1e-10) ans-=(ans*ans*ans-n)/(3*ans*ans);
        printf("%.8lf\n",ans);
    }
    return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include <math.h>
#include<string.h>
#include<limits.h>

int main(){
	int i;
	double q,x[1000000];
	
	while(1){
	scanf("%lf",&q);
		if(q==-1)break;
	x[0]=q/2;
	
	for(i=0;;i++){
		x[i+1]=x[i]-(x[i]*x[i]*x[i]-q)/(3*x[i]*x[i]);
		if(fabs(x[i]*x[i]*x[i]-q)<0.00001*q)break;
	}
	printf("%f\n",x[i+1]);
	}
return 0;
}