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

Python: from itertools import accumulate
while True:
    try:
        data = list(map(int, input().split(',')))
        l = data[0:10]
        v1 = data[10]
        v2 = data[11]

        l = list(accumulate(l))
        d = l[9] / (v1 + v2) * v1
        l.insert(0, 0)
        for i in range(len(l)):
            if l[i] < d <= l[i+1]:
                print(i+1)
                break
    except:
        break

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

int main()
{
	int lengthes[10];
	char tmp;
	while (std::cin >> lengthes[0] >> tmp >> lengthes[1] >> tmp >> lengthes[2] >> tmp >> lengthes[3] >> tmp >> lengthes[4] >> tmp >> lengthes[5] >> tmp >> lengthes[6] >> tmp >> lengthes[7] >> tmp >> lengthes[8] >> tmp >> lengthes[9] >> tmp )
	{
		int v1, v2;
		std::cin >> v1 >> tmp >> v2;

		int sum = std::accumulate(&lengthes[0], &lengthes[10], 0);

		double sec = (double)(sum) / (v1 + v2);
		double dist = v1 + sec;

		int all = 0;
		int index = 1;
		for (auto length : lengthes)
		{
			all += length;
			if (dist < all)
			{
				std::cout << index << std::endl;
				break;
			}
			index++;
		}
	}

	return 0;
}

C++: 

#include <iostream>

using namespace std;

int main(void){

  double l[10];
  double v1,v2;
  char ten;

  while( cin >> l[0] ){

    for( int i = 1 ; i < 10 ; i++ ){
      cin >> ten >> l[i];
    }
    cin >> ten >> v1 >> ten >> v2;

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

    way = way * ( v1 / ( v1 + v2 ) );

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

  }
  return 0;
}

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){
        for(int i=0;i<10;i++){
            n+=l[i];
        }
        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+1 << endl;
                break;
            }
        }
    }
	return 0;
}

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

#define SIZE 10

int main() {
	char t;
	while (!cin.eof()) {
		int l[SIZE] = { 0 }, v1, v2;
		double s;
		for (int i = 0; i < SIZE; i++) {
			cin >> l[i];
			cin >> t;

			s += l[i];
		}
		cin >> v1 >> t >> v2;
		s = s * v1 / (v1 + v2);

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

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

int main(){
	double l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2;
	char c;
	while(cin>>l1>>c>>l2>>c>>l3>>c>>l4>>c>>l5>>c>>l6>>c>>l7>>c>>l8>>c>>l9>>c>>l10>>c>>v1>>c>>v2){
		double total_l=l1+l2+l3+l4+l5+l6+l7+l8+l9+l10;
		double t=total_l/(v1+v2);
		double pos=v1*t;
		if(pos<=l1) cout << 1 << endl;
		else if (pos<=l1+l2) cout << 2 << endl;
		else if (pos<=l1+l2+l3) cout << 3 << endl;
		else if (pos<=l1+l2+l3+l4) cout << 4 << endl;
		else if (pos<=l1+l2+l3+l4+l5) cout << 5 << endl;
		else if (pos<=l1+l2+l3+l4+l5+l6) cout << 6 << endl;
		else if (pos<=l1+l2+l3+l4+l5+l6+l7) cout << 7 << endl;
		else if (pos<=l1+l2+l3+l4+l5+l6+l7+l8) cout << 8 << endl;
		else if (pos<=l1+l2+l3+l4+l5+l6+l7+l8+l9) cout << 9 << endl;
		else if (pos<=total_l) cout << 10 << endl;
	}
	return 0; 
}

C++: // 問題: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0034
#include <iostream>
#include <vector>

bool input(std::vector<int> & l, int & v1, int & v2)
{
	char comma;
	if (!(std::cin >> l[0])) return false;
	for (int i = 1; i < 10; i++) {
		std::cin >> comma >> l[i];
	}
	std::cin >> comma >> v1 >> comma >> v2;
	return true;
}
int sum_of_length(std::vector<int> l) // 全体の道のり(距離)
{
	int sum = 0;
	for (std::vector<int>::size_type i = 0; i < l.size(); i++) {
		sum += l[i];
	}
	return sum;
}
double left_length(int v1, int v2, std::vector<int> l)
{		
	// 全体の道のり.(ふたつの列車の走る合計の距離)
	int    distance = sum_of_length(l);
	// ふたつの列車がすれ違った時の時間(=走る時間はふたつの列車共同じ)
	double hour     = static_cast<double>(distance) / (v1 + v2);
	// 左の列車がどれくらいの距離を走ったか
	return v1 * hour;
}
int get_sect(std::vector<int> l, const double left_length)
{
	int sum = 0;
	for (std::vector<int>::size_type i = 0; i < l.size(); i++) {
		sum += l[i];
		if (left_length <= sum) return i + 1;
	}
	return -1;
}
int main()
{
	int              v1, v2;    // 左からの列車の速さ, 右からの列車の速さ
	std::vector<int> l(10, 0); // 各区間の距離x10
	while (input(l, v1, v2)) {
		std::cout << get_sect(l, left_length(v1, v2, l)) << std::endl;
	}
}

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


int main(){
		
	int km[10],v1,v2,n; char a;
	double length; int leng[11] ;
	while(1){
	if(cin.eof()) break;
	for(int i=0;i<10;i++)
	cin >> km[i] >> a;
	cin >> v1 >> a >> v2;	
	leng[0] = 0;
	for(int k =0;k<10;k++)
	leng[k+1] = leng[k] + km[k];
	length = (double)leng[10] * ((double)v1 / ((double)v1 + (double)v2)); 
	for(int k=0;k<10;k++){
	if(leng[k] >= length ){
	cout << k <<endl; break;
	}
	}	
	}
}

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

int main(){
  int l[10];
  int t1,t2;
  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],&t1,&t2)>0){
    float p=(accumulate(l,l+10,0)*t1)/(float)(t1+t2);
    for(int i=0;i<10;i++){
      p-=l[i];
      if(p<=0){
	printf("%d\n",i+1);
	break;
      }
    }
  }
  return 0;
}

C++: #include<cstdio>

using namespace std;

int date[12];

int main()
{
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&date[0],&date[1],&date[2],&date[3],&date[4],&date[5],&date[6],&date[7],&date[8],&date[9],&date[10],&date[11])!=EOF)
	{
		int line=0;//合計の距離
		for(int i=0;i<10;i++)line+=date[i];
		double d = line*date[10];
		d/=(date[10]+date[11]);
		int k=0;
		for(int i=0;i<10;i++)
		{
			k+=date[i];
			if(d<=k)
			{
				printf("%d\n",i+1);
				break;
			}
		}
	}
}

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+1 << endl;
                break;
            }
        }
    }
	return 0;
}