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

C++: #include<iostream>
#include<stdio.h>

using namespace std;

int main()
{
	int i,c;
	double vsum,lsum,t,v1l;
	int v1,v2;
	int l[11];

	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&l[10],&v1,&v2)!=EOF)
	{
		lsum=0;
		vsum=v1+v2;
		for(i=1;i<11;i++)
			lsum+=l[i];
		t=lsum/vsum;
		v1l=t*v1;
		i=1;
		while(v1l>0){
			v1l-=l[i];
			i++;
		}

		printf("%d\n",--i);
	}
	return 0;
}

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

using namespace std;

#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int num[5000];

int main() {
	double v1, v2;
	double l[10];
	while(scanf("%lf,", &l[0]) != EOF) {
		int adis = 0, sum = l[0];
		FOR(i, 1, 10) {
			scanf("%lf,", &l[i]);
			sum += l[i];
		}
		scanf("%lf,%lf", &v1, &v2);
		rep(i, 10) {
			adis += l[i];
			double time = adis / v1;
			double bdis = v2 * time;
			if(sum <= adis + bdis) {
				printf("%d\n", i + 1);
				break;
			}
		} 
	}
	return 0;
}

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

using namespace std;

int main(int argc, char *argv[])
{
  int l[10];
  int v1,v2;
  int L;
  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],&v1,&v2) !=EOF){
  for(int i = 0;i < 9;i++){
    L += l[i];
  }
  double d;
  d =(double)L*v1/(v1+v2);
  L =0;
  for(int i = 0;i < 10;i++){
    L += l[i];
    if(d <=L){
      printf("%d\n",i+1);
      break;
    }
  }
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <array>

using namespace std;

constexpr int STATION = 10;

int main()
{
    string buf;
    while (getline(cin, buf)) {
        for (unsigned i = 0; i < buf.size(); i++) {
            if (buf.at(i) == ',') {
                buf.at(i) = ' ';
            }
        }

        stringstream ss(buf);
        array<int, STATION> interval;
        double vel01, vel02, vel_sum;
        for (size_t i = 0; i < STATION; i++) {
            ss >> interval.at(i);
        }
        ss >> vel01 >> vel02;
        vel_sum = vel01 + vel02;

        double length = 0;
        for (size_t i = 0; i < STATION; i++) {
            length += interval.at(i);
        }

        int ans = 1;
        for (size_t i = 0; i < STATION; i++) {
            double time = interval.at(i) / vel01;
            length -= time * vel_sum;
            if (length > 0) {
                ans++;
            } else {
                break;
            }
        }

        cout << ans << endl;
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int l[10];
    int v1, v2;
    int passby; //上り電車が進んだ距離
    int num; //すれ違った区間の番号
    int length; //線路の長さ
    
    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], &v1, &v2) != EOF){
        for(int i = 0; i < 10; i++){
            length += l[i];
        }
        passby = length * v1 / (v1 + v2); //この式は上り電車と下り電車の移動時間が等しいという式の形を変えたもの
        
        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<vector>
#include<iostream>
using namespace std;

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

int main(){
	vector<double> l(10);
	vector<double> v(2);
	char c;
	
	while(cin>>l[0]){
		rep(i,9) cin >> c >> l[i+1];
		rep(i,2) cin >> c >> v[i];
		double sum = 0,sum2=0,sum3=0;
		rep(i,l.size()) sum += l[i];
		rep(i,v.size()) sum2 += v[i];
		rep(i,l.size()) {
			sum3+=l[i];
			if(sum3/sum>=v[0]/sum2){
				cout << i+1 << endl;
				break;
			}
		}
	}
}

C++: #include<iostream>
#include<vector>
#include<stdio.h>
int main(){
	int v1,v2;
	std::vector<int> vec(10);
	while(scanf("%d,",&vec[0])!=EOF) {
		float sum=0;
		for(int i=1;i<10;i++){
			scanf("%d,",&vec[i]);
			//std::cin>>vec[i];
			sum+=vec[i];
		}
		scanf("%d,%d",&v1,&v2);
		//std::cin>>v1>>v2;
		if(std::cin.eof())break;
		float time=sum/(v1+v2);
		float a=v1*time;
		int b=0;
		while(a>0){
			a-=vec[b];
			b++;
		}
		std::cout<<b<<std::endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	double l[10];
	double v[2];
	char c;
	while (cin >> l[0] >> c >> l[1] >> c >> l[2] >> c >> l[3] >> c >> l[4] >> c >> l[5] >> c >> l[6] >> c >> l[7] >> c >> l[8] >> c >> l[9] >> c >> v[0] >> c >> v[1]) {
		double a = 0;
		for (int i = 0; i < 10; i++){
			a += l[i];
		}
		a = a * v[0] / (v[0] + v[1]);
		for (int i = 0; i < 10; i++){
			a -= l[i];
			if (a == 0){
				cout << i + 1 << endl;
				goto c;
			}else if (a < 0){
				cout << i + 1 << endl;
				goto c;
			}
		}
	c:
		a = 0;
	}
}

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

int main(void){
  double l[10];
  double v1, v2;
  char c;
  while(!cin.eof()){
    double ls = 0;
    for(int i = 0; i < 10; i++){
      cin >> l[i] >> c;
      ls += l[i];
    }
    cin >> v1 >> c >> v2;
    
    double vr = v1 / v2;
    double x = (vr * ls) / (1 + vr);

    double y = 0.0;
    int cnt = 0;

    while(y < x){
      y += l[cnt];
      cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}