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()
{
	double l[10], sum, v1, v2;
	char c;

	while (1) {
		for (int i = 0; i < 10; i++) {
			cin >> l[i] >> c;
		}
		if (cin.eof())	break;

		cin >> v1 >> c >> v2;

		sum = 0;
		for (int i = 0; i < 10; i++) {
			sum += l[i];
		}

		sum *= v1 / (v1 + v2);

		for (int i = 0; i < 10; i++) {
			sum -= (double)l[i];
			
			if (sum <= 0) {
				cout << i + 1 << endl;
				break;
			}
		}
	}

	return 0;
}

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

int main(){
  int l[10];
  int v1,v2, d;
  double t, dis;
  char c;
  while( cin>>l[0] && l[0] ){
    d=l[0];
    for( int i=1;i<10;i++ ){
      cin >> c >> l[i];
      d += l[i];
    }
    cin >> c >> v1 >> c >> v2;

    if( v1==0 )
      cout << 1 << endl;
    else if( v2==0 )
      cout << 10 << endl;
    else{
      t = (double)d/(v1+v2);
      dis = v1*t;
      d=0;
      for( int i=0;i<10;i++ ){
	d += l[i];
	if( 1.0e-8 > dis - d ){
	  cout << (i+1) << endl;
	  break;
	}
	if( i==9 )
	  cout << 10 << endl;
      }
    }
  }
  return 0;
}

C++: #include <stdio.h>

int main(void){
	int l[10];
	int v1, v2;
	int len, tl;
	float p;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
		l, l+1, l+2, l+3, l+4, l+5, l+6, l+7, l+8, l+9, &v1, &v2) != EOF){
		len = 0;
		for(int i=0;i<10; ++i){
			len += l[i];
		}
		p = v1 * len / (float)(v1 + v2);
		if(p == 0.0){ puts("0"); break;}
		tl = 0;
		for(int i=0; i<10; ++i){
			tl += l[i];
			if(tl == p){
				printf("%d\n", i+1);
				break;
			}else if(tl > p){
				printf("%d\n", i+1);
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void){
	while(true){
		if(cin.eof())
			break;
		int line[10];
		char tmp;
		cin >> line[0] >> tmp;
		for(int i=1;i<10;i++)
			cin >> line[i] >> tmp,line[i]+=line[i-1];
		double v1,v2;
		cin >> v1 >> tmp >> v2;
		double t=line[9]/(v1+v2);
		double tar=v1*t;
		int i;
		for( i=0;i<10;i++)
			if(tar<=line[i])
				 break;
		cout << i+1 << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const double EPS = 1e-9;

int main(){
	int l[10], v[2];
	while(scanf("%d,", &l[0])!=EOF){
		for(int i=1; i<10; i++){
			scanf("%d,", &l[i]);
		}
		scanf("%d,%d", &v[0], &v[1]);
		
		int total=0;
		for(int i=0; i<10; i++){
			total += l[i];
		}
		
		double t = (double)total/(v[0]+v[1]);
		double d = v[0]*t -EPS;
		int sum=0;
		for(int i=0; i<10; i++){
			sum += l[i];
			if(sum > d){
				cout << i+1 << endl;
				break;
			}
		}
	}
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<char, int>P;

float l[10], sum[11];
int main() {
	int v1, v2;
	while (scanf("%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%d,%d", &l[0], &l[1], &l[2], &l[3], &l[4], &l[5], &l[6], &l[7], &l[8], &l[9], &v1, &v2) != EOF) {
		float cnt = 0;
		rep(i, 10) {
			sum[i] = cnt;
			cnt += l[i];
		}
		sum[10] = cnt;
		cout << lower_bound(sum, sum + 11, (sum[10] / (v1 + v2))*v1) - sum << endl;
	}
	return 0;
}

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

int main(){
	while(1){
		long L[10], v1, v2, s=0;
		bool end=false;
		for(int i=0; i<10; ++i){
			if(scanf(" %ld,", &L[i])==EOF){
				end=true;
				break;
			}	
			s+=L[i];
		}
		if(end) break;
		scanf(" %ld,%ld", &v1, &v2);
		
		s*=v1+v2;
		for(int i=0; i<10; ++i) L[i]*=v1+v2;
		
		int ans=1;
		long now=0;
		long v1t=v1*s/(v1+v2);
		while(now<v1t){
			now+=L[ans-1];
			++ans;	
		}
		
		printf("%d\n", ans-1);
	}
}

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

using namespace std;

typedef unsigned long long ull;
#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define all(a) (a).begin(), (a).end()

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

int main(){
	vector<int> v(10);
	int v1, v2;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&v[0],&v[1],&v[2],&v[3],&v[4],&v[5],&v[6],&v[7],&v[8],&v[9],&v1,&v2) != EOF){
		double sum = 0;
		rep(i, 10) sum += v[i];
		double n = sum*v1/(v1+v2);
		sum = 0;
		rep(i, 10) if(sum+v[i] >= n){cout << i+1 << endl; break;} else sum += v[i];
	}
}

C++: #include<iostream>

using namespace std;

int solve(int l[10],int v[2])
{
	double sum=0;
	double t;
	double len;
	for(int i=0;i<10;i++)
	{
		sum+=l[i];
	}
	t=sum/(v[0]+v[1]);
	len=v[0]*t;
	sum=0;
	for(int i=0;i<10;i++)
	{
		sum+=l[i];
		if(len<=sum)
		{
			return i+1;
		}
	}
}

int main(void)
{
	int l[10],v[2];
	char c;
	while(cin>>l[0])
	{
		for(int i=1;i<10;i++)
		{
			cin>>c>>l[i];
		}
		for(int i=0;i<2;i++)
		{
			cin>>c>>v[i];
		}
		cout<<solve(l,v)<<endl;
	}
}

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

int main()
{
    int l[10] , v1 , v2 , n , m;
    double d , t;
    char ch;
    while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2>>ch){
        t=n/(v1+v2);
        d=v1*t;    //列車1の動く距離
        m=0;
        for(int i=0;i<10;i++){
            m+=l[i];
            if(m<d){
                cout << i << endl;
                break;
            }
        }
    }
	return 0;
}

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

using namespace std;

int main(){
    vector<int> v(10);
    int sp1, sp2;
    double all=0;
    char k;

    while(cin>>v.at(0)){
        for(int i=1; i<10; i++){
            cin >>k >>v.at(i);
        }
        cin>>k >>sp1 >>k >>sp2;

        for(int i=0; i<10; i++){
            all += v.at(i);
        }

        double hour = all/(sp1+sp2);
        double len = sp1*hour;

        int k = 0;
        while(len>0){
            len -= (double)v.at(k);
            k++;
        }

        cout<< k<< endl;
    }

    return 0;
}

C++: #include <bits/stdc++.h>
 
int main()
{
    int tr[10], v1, v2;
   
    while (~scanf("%d", &tr[0])) {
        int sum = tr[0];
        for (int i = 1; i < 10; i++) {
            scanf(",%d", &tr[i]);
            sum += tr[i];
        }
        scanf(",%d,%d", &v1, &v2);
         
        double a = v1 * ((double)sum/(v1+v2));
         
        sum = 0;
        for (int i = 0; i < 10; i++) {
            sum += tr[i];
            if (a <= sum) {
                printf("%d\n" ,i+1);
                break;
            }
        }
    }
    return 0;
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>

using namespace std;

int rail[11],raill,railal,sp[2];
double  c1,c2;
int main(void){
	int a,b;
	while(~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&rail[1],&rail[2],&rail[3],&rail[4],&rail[5],&rail[6],&rail[7],&rail[8],&rail[9],&rail[10],&sp[0],&sp[1])){
		raill=0;
		c1=(double)sp[0]/(sp[0]+sp[1]);
		for(a=1;a<=10;a++){
			railal+=rail[a];
		}
		for(a=1;a<=10;a++){
			raill+=rail[a];
			c2=(double)raill/railal;
			if(c2>c1){
				cout << a-1 << endl;
				break;
			}
		}
	}
	return 0;
}