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>
#include <vector>
#include <map>
#include <stack>
#include <list>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <math.h>

#define PREP(i, m, n) for(int i = m; i < n; i++)
#define MREP(i, m, n) for(int i = m - 1; i >= n; i--)
using namespace std;

class train{
	public:
		int v;
		double vRatio;
		double distance;
		int currentSta;

		train(int v = 0, double vRatio = 0.0, double distance = 0.0, int currentSta = 0):v(v), vRatio(vRatio), distance(distance), currentSta(currentSta){}
		
		void wantVRatio(int other){
			vRatio = (double)v / ((double)v + (double)other);
		}

		void wantDistance(int railsum){
			distance = (double)railsum * vRatio;
		}
	private:

	protected:

};


int main(){
	while(1){
		map<int, int> rail;
		int railsum = 0;
		train up, down(0,0.0,0.0,10);

		if(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &rail[0], &rail[1], &rail[2], &rail[3], &rail[4], &rail[5], &rail[6], &rail[7], &rail[8], &rail[9], &up.v, &down.v) == EOF){
			break;
		}

		PREP(i, 0, 10){
			railsum += rail[i];
		}

		up.wantVRatio(down.v);
		down.wantVRatio(up.v);
		up.wantDistance(railsum);
		down.wantDistance(railsum);

		PREP(i, 0, 10){
			up.distance -= rail[i];
			if(up.distance < rail[i]) {
				up.currentSta = i;
				break;
			}
		}

		MREP(i, 10, 0){
			down.distance -= rail[i];
			if(down.distance < rail[i]){
				down.currentSta = i;
				break;
			}
		}

		//この2の内訳は、インデックスが0~9までに対して問題の区間番号が1~10定義になっているので+1と
		//仮に各電車の区間番号が5,7だった場合、すれ違うのは6なので5+1のための+1
		cout << ((down.currentSta - up.currentSta) == 1 ? up.currentSta + 1 : up.currentSta + 2) << 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){
        n=0;
        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 "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
int main(){
	char ch;
	int n[12];
	int v1,v2;
	while( cin>>n[0]>>ch>>n[1]>>ch>>n[2]>>ch>>n[3]>>ch>>n[4]>>ch>>n[5]>>ch>>n[6]>>ch>>n[7]>>ch>>n[8]>>ch>>n[9]>>ch>>v1>>ch>>v2 ){
		int l=0;
		rep(i,10){
			l+=n[i];
		}
		double val=v1/( (double)(v1+v2)/l );

		int now=0;
		int ans=10;
		rep(i,10){
			now+=n[i];
			if(now>=val){
				ans=i+1;
				break;
			}
		}

		cout<<ans<<endl;

	}
}

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

using namespace std;

int main(){
    vector<int> v(10);
    vector<int> ::iterator it;
    int sp1, sp2;
    double all=0, sp_sum;

    while(cin>>v.at(0)){
        for(it = v.begin()+1; it != v.end(); it++){
            cin>> *it;
        }
        cin>> sp1>> sp2;

        for(it = v.begin(); it != v.end(); it++){
            all += *it;
        }
        sp_sum = sp1+sp2;

        double hour = all/sp_sum;
        double x = sp1*hour;

        int k = 0;
        it=v.begin();
        while(x>0){
            x -= *it;
            it++;
            k++;
        }

        cout<< k<< endl;
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int l[10];
    int v[2];
    int passby; //上り電車が進んだ距離
    int num; //すれ違った区間の番号
    int length = 0; //線路の長さ
    
    while(scanf("%d,", &l[0]) != EOF){
        length = l[0];
        for(int i = 1; i < 10; i++){
            scanf("%d,", &l[i]);
            length += l[i];
        }
        scanf("%d,%d", &v[0], &v[1]);
        
        passby = length * v[0] / (v[0] + v[1]); //この式は上り電車と下り電車の移動時間が等しいという式の形を変えたもの
        
        int sum = 0; //sum:すれ違った区間の番号を調べるのに必要
        for(int i = 0; i < 10; i++){
            sum += l[i];
            if(passby == l[i]) num = l[i];
        }
        cout << num << endl;
    }
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    while(true){
        int l[10];
        if(!(cin>>l[0])) break;
        cin.ignore();
        for(int i=1; i<10; i++){
            cin>>l[i];
            cin.ignore();
        }
        int sum=0;
        for(int i=0; i<10; i++) sum+=l[i];
        int v1, v2;
        cin>>v1;
        cin.ignore();
        cin>>v2;
        double point=(double)sum*v1/(v1+v2);
        int pt=ceil(point);
        int ll=0;
        for(int i=0; i<10; i++){
            ll+=l[i];
            if(pt<=ll){
                cout<<i+1<<'\n';
                break;  
            } 
        }
    }
    return 0;
}

C++: #include <stdio.h>

int main(void) {

  int l1,l2,l3,l4,l5,l6,l7,l8,l9,l10;
  int v1,v2;

  double intersec;
  int l[10];
  int result;

  int i;


  while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l1,&l2,&l3,&l4,&l5,&l6,&l7,&l8,&l9,&l10,&v1,&v2)!=EOF) {

    intersec=(double)(l1+l2+l3+l4+l5+l6+l7+l8+l9+l10)*v1/(double)(v1+v2);

    l[0]=l1; l[1]=l2; l[2]=l3; l[3]=l4; l[4]=l5; l[5]=l6; l[6]=l7; l[7]=l8; l[8]=l9; l[9]=l10;

    for(i=0;i<10;i++) {

      intersec-=l[i];
      
      if(intersec<=0) {

	printf("%d\n",i+1);
	break;

      }

    }

  }

}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
using namespace std;
int main(){
	
	int l[10];
	int v1,v2;
	int sum;
	char comma;
	double h,d;
	int ans;
	
	while(cin>>l[0]){
		
		sum=l[0];
		
		for(int i=1;i<10;i++){
			cin>>comma>>l[i];
			sum+=l[i];
		}
		cin>>comma>>v1>>comma>>v2;
		
		h=double(sum)/(v1+v2);
		d=double(v1)*h;
		
		for(int i=0;i<10;i++){
			d-=l[i];
			if(d<=0){
				ans=i+1;
				break;
			}
		}
		cout<<ans<<endl;
		
	}
	
}

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

int main()
{
    float l[11];
    float v1,v2;
    char s;
    while(1)
    {
        for(int i=1;i<=10;i++){
            cin >> l[i] >> s;
        }
        cin >> v1 >> s >> v2;
        if(cin.eof()) break;
       

        float t,la;
        float lsum=0;
        for(int i=1;i<=10;++i){
            lsum+= l[i];
        }

        t = lsum/(v1+v2);
        la = v1*t;
        lsum = 0;
        for(int i=1;i<10;i++)
        {
            lsum += l[i];
            if(lsum >= la){ cout << i << endl; break;}
        }
        if(lsum < la)cout << 10 << endl;
    }

    return 0;
}