Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	a := make([]float64, 10)
	for scanner.Scan() {
		info := strings.Split(scanner.Text(), ",")
		for j := 0; j < 10; j++ {
			a[j], _ = strconv.ParseFloat(info[j], 64)
		}
		v1, _ := strconv.ParseFloat(info[10], 64)
		v2, _ := strconv.ParseFloat(info[11], 64)
		sum := 0.0
		for i := 0; i < 10; i++ {
			sum += a[i]
		}
		match := v1 * ((sum/(v1+v2)))
		if match == 0 {
			fmt.Println(1)
		} else {
			sum = 0
			for k := 0; k < 10; k++ {
				sum += a[k]
				if match <= sum {
					fmt.Println(k+1)
					break
				}
			}
		}
	}
}

C++: #include <iostream>

using namespace std;

int main(){
  int l[10],l_sum = 0,v1,v2;
	char d;
	double t;
	while(1){
	  for(int i=0;i<10;i++){
		cin >> l[i] >> d;
		l_sum += l[i];
	  }
	  cin >> v1 >> d >> v2;
	  if(cin.eof())break;
	  int l_v1 = 0,l_tmp = 0,ans=0;
	  l_v1 = (l_sum*v1) /(v1 + v2);
 
	  while(l_tmp < l_v1){
		l_tmp += l[ans];
		ans++;
	  }
	 
	cout << ans << endl;  
	}
}

C++: #include <bits/stdc++.h>
#define _USE_MATH_DEFINES
using namespace std;
 
 
#define li			long long int
#define rep(i,to)	for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)	for(li i=(li)(start);i<((li)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define rjm	rep(j,m)


#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)		idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)	for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)		idp p2((x).F, (x).S)
#define dump(x,n)	idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)	idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)	idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)	idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)	rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)	rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}


#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007


vector<string> split(const string &str, char delim){
	istringstream iss(str); string tmp; vector<string> res;
	while(getline(iss, tmp, delim)) res.push_back(tmp);
	return res;
}

li interval[11];
li v[2];

inline li stoi(string s){
	return atoi(s.c_str());
}

int main(){
	string s;
	while(cin>>s){
		if(s=="h")break;
		vector<string> ss=split(s, ',');
		rep(i,10)interval[i]=stoi(ss[i]);
		rep(i,2)v[i]=stoi(ss[i+10]);

		li sum=0;
		rep(i,10)sum+=interval[i];
		double ans=(double)sum*v[0]/(v[0]+v[1]);
		//cout<<ans<<endl;
		li now=0;
		rep(i,10){
			now+=interval[i];
			if(now>=ans){
				cout<<i+1<<endl;
				break;
			}
		}
	}
	
	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[10];
	double u,v;
	
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&u,&v)!=EOF){
		int sum = 0;
		rep(i,10)sum+=a[i];
		
		double par = u/(u+v);
		double pos = sum*par;
		
		int sum2 = 0;
		rep(i,10){
			sum2 += a[i];
			if(sum2+0.0000001>pos){
				printf("%d\n",i+1);
				break;
			}
		}
	}
	
}

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

using namespace std;

int l[10];
int a, b;

int main()
{
    while (~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&a,&b)) {
        for (int i = 1; i < 10; ++i) l[i] += l[i - 1];
        double c = (double)l[9] / (a + b) * a;
        for (int i = 9; i >= 0; --i) if (c >= l[i]) { printf("%d\n", i + 2 - (c == l[i])); break; }
    }
}

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

using namespace std;

int main(){
	int l[10],sum;
	double x,y;
	double v1,v2;
	while(scanf("%d",&l[0])!=EOF){
		sum=l[0];
		for(int i=1;i<10;i++){
			scanf(",%d",&l[i]);
			sum+=l[i];
		}
		scanf(",%lf,%lf",&v1,&v2);
		x=(v1*sum)/(v1+v2);
		y=sum-x;
		int pass;
		double temp=0;
		for(int i=0;i<10;i++){
			temp+=l[i];
			if(temp>=x){
				pass=i;
				break;
			}
		}
		printf("%d\n",pass+1);
	}
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(void){
    int l[10];
    int v1,v2;
    int l_total;
    double sec_tmp;
    int sec;
    int i;
    
    while(true){
        l_total=0;
        for(i=0;i<10;i++){
            if(scanf("%d,",&l[i])==EOF)return 0;
            l_total+=l[i];
        }
        scanf("%d,%d",&v1,&v2);
        sec_tmp=(double)(v1*l_total)/(v1+v2);
        i=0;
        while(sec_tmp>0){
            sec_tmp-=(double)l[i];
            i++;
        }
        cout<<i<<endl;
    }
}

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

int main(){
	int dis[10], v_0 = 0,v_1 = 0;
	while( scanf("%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",&dis[0],&dis[1],&dis[2],&dis[3],&dis[4],&dis[5],&dis[6],&dis[7],&dis[8],&dis[9],&v_0,&v_1)){
		int dsum = 0;
		double acum[10];
		for(int x=0;x<10;++x){
			dsum += dis[x];
			acum[x] = 1.0*dsum;
		}		
		double dd = v_0 * (dsum*1.0/(v_0+v_1));
		//cout<<dd<<endl;
		int index = 0;
		while(index<10 && acum[index]<dd){
			++index;
		}
		--index;
		if(acum[index]==dd)cout<<index+1<<endl;
		else cout<<index+2<<endl;
	}
	return 0;
}

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

int main(){
  int l[10];
  char c;
  while(1){
    for(int i = 0 ; i < 10 ; i++){
      cin >> l[i] >> c;
      if(cin.eof()) return 0;
    }
    int a, b;
    cin >> a >> c >> b;
    
    int n = 0;
    for(int i = 0 ; i < 10 ; i++){
      n += l[i];
    }
    double h = (double)n/(a+b);
    double d = (double)a*h;
    
    n = 0;
    
    for(int i = 0 ; i < 10 ; i++){
      n += l[i];
      if(d <= n){
	cout << i+1 << endl;
	break;
      }
    }
  }
  return 0;
}

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

int main()
{
	int len[10];
	int v1,v2;
	while( scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &len[0],&len[1],&len[2],&len[3],&len[4],&len[5],&len[6],&len[7],&len[8],&len[9],&v1,&v2) != EOF ){
		int accum[10] = {0};
		accum[0] = len[0];
		for(int i=1;i<10;i++){
			accum[i] += accum[i-1] + len[i];
		}
		cout<<accum[9]<<endl;
		// accum[9] は合計の距離
		double t = (double)accum[9]/(v1 + v2);
		double dist = (double) v1*t;
		for(int i=0;i<10;i++){
			if( dist < accum[i] ){
				cout<<i<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a[10];
	int v1,v2;
	while(scanf("%d",a)!=EOF){
		for(int i=1;i<10;i++){
			scanf(",%d",&a[i]);
			a[i] += a[i-1];
			cout<<a[i]<<' ';
		}
		scanf(",%d,%d\n",&v1,&v2);
		int ans;
		for(int i=9;i>=0;i--){
			if(v1*a[9] <= a[i]*(v1+v2))ans=i;
		}
		cout<<ans+1<<endl;
	}
	return 0;
}