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], v1, v2, sum, buf, ans;
	float point;
	char c;


	while (1){
		sum = 0;
		ans = 0;
		buf = 0;

		for (int i = 0; i < 10; i++){
			cin >> L[i];
			cin >> c;
			sum += L[i];
		}
		cin >> v1 >> c >> v2;

		if (cin.eof()) break;

		point = (float)sum * v1 / (v1 + v2);

		for (int i = 0; i < 10; i++){
			buf += L[i];
			if ((float)buf >= point){
				ans = i + 1;
				break;
			}
		}

		cout << ans << endl;

	}


	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int distance[10], v1, v2;
    char garbage;
    while(cin >> distance[0]){
        cin >> garbage;
        double lineLength = distance[0];
        range(i,1,10){
            cin >> distance[i] >> garbage;
            lineLength+= distance[i];
        }
        cin >> v1 >> garbage >> v2;
        double sum_v = v1 + v2;
        double time = lineLength / sum_v;
        double pass_location = v1 * time;
        rep(i,10){
            pass_location-= static_cast<double>(distance[i]);
            if(pass_location <= 0){
                cout << i + 1 << endl;
                break;
            }
        }
    }
}

C++: #include<cstdio>
using namespace std;
int main(){

  int a[11],b,c;
  
  while(scanf("%d,",&a[1]) != EOF){
    
    a[0] = 0;
    for(int i=2;i<=10;i++){
      scanf("%d,",&a[i]);
      a[i] += a[i-1];
    }
    scanf("%d,%d",&b,&c);
    
    double sum = (double)a[10]/(b+c)*b;
    
    for(int i=1;i<=10;i++){
      if(sum<=a[i]){
	printf("%d\n",i);
	break;
      }
    }
    
  }    

  return (0);
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){

	int l[15];
	int i,a,b;

	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)!=EOF){

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

	double c=0,d=0;
	for(i=0;i<10;i++){
        //c+=l[i];
        c+=l[i];
        d+=(double)l[i]/a*b;
        //cout<<"-"<<c<<"-"<<d<<endl;
        if(c+d>=sum)break;
	}
	cout<<i+1<<endl;

	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <complex>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59

int arr[20010];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    //cout << fixed << setprecision(3);
    int l[10];
    int v1, v2;
    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])
    {
        cin >> c >> v1 >> c >> v2;

        int sum = 0;
        double c = (double)v1 / (v1 + v2);

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

        int partsum = 0;

        for (int i = 0; i < 10; ++i)
        {
            partsum += l[i];
            if ((double)partsum / sum >= c)
            {
                cout << i + 1 << endl;
                break;
            }
        }
    }
    return 0;
}

C++: //0034 Railway Lines

#include<iostream>
#include<numeric>
using namespace std;

int main(void)
{
	while(1)
	{
		const int N = 10;
		int l[N];
		int v1, v2;
		int i;
		char dummy;
		for(i = 0; i < N; i++)
		{
			cin >> l[i] >> dummy;
		}
		if(!cin)
			break;
		cin >> v1 >> dummy >> v2;

		//Jnw©çÌ£
		int p[N];
		partial_sum(l, l+N, p);
		//v1+v2ÌXs[hÅsum(l)ð¥j·éÔª·êá¤Ô
		double t = ((double)p[N-1] / (v1+v2));
		double crashP = v1*t;	//·êá¤Êu
		//ãÍÔÉ©Ä¢­¾¯
		for(i = 0; i < N; i++)
		{
			if(p[i] >= crashP)
			{
				cout << i+1 << endl;
				break;
			}
		}
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cmath>
using namespace std;

int nowPlace(int in[], int now, int miFlag){
	int p = 0, m = 0, ptr = 0;
	if (miFlag == 0){
		while (p <= now){
			p += in[ptr];
			ptr++;
		}
		return ptr;
	}
	else{
		ptr = 9;
		while (m <= now){
			m += in[ptr];
			ptr--;
		}
		ptr += 2;
		return ptr;
	}
}

int solve(int in[]){
	cout << "nowSolve" << endl;
	int plusV = in[10];
	int miV = in[11];
	int minFlag = 0,  SA = plusV - miV;
	if (SA < 0)	minFlag = 1;
	// 現在位置
	int nowPlus = 0, nowMi = 0;
	for (int i = 0; i < 10; i++)	in[i] *= 1000;
	while (1){
		nowPlus++;
		nowMi++;
		if (minFlag)	nowMi += -SA;
		else			nowPlus += SA;
		cout << "nowPlus = " << nowPlus << " , nowMi = " << nowMi << endl;
		cout << "nowPlace plus = " << nowPlace(in, nowPlus, 0) << " , nowPlace mi = " << nowPlace(in, nowMi, 1) << endl;
		if (nowPlace(in, nowPlus, 0) >= nowPlace(in, nowMi, 1))
			return nowPlace(in, nowPlus, 0);
	}

}

int solve2(int in[]){
	int longSum = 0, v1 = in[10], v2 = in[11];
	int ptr = 0;
	double temp = 0;
	for (int i = 0; i < 10; i++)	longSum += in[i];
	// (左端0としたときの)すれちがう位置
	temp = (double)(longSum * v1) / (v1 + v2);
	while (temp > 0){
		temp -= in[ptr];
		ptr++;
	}
	return ptr;
}

int main(){
	int in[13];
	while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
		&in[0], &in[1], &in[2], &in[3], &in[4], &in[5], &in[6], &in[7], &in[8], &in[9], &in[10], &in[11])
		!= EOF){
		cout << solve2(in) << endl;
	}
	return 0;
}

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

int main(){

int l[10];
float li=0;
float lSum=0;
float v1,v2;
int i=0;
char c;

while(true){
for(i=0;i<10;i++){
	cin>>l[i]>>c;
	lSum+=l[i];
}

cin>>v1>>c>>v2;

for(i=0;;i++){
	li+=l[i];
	if(lSum*(v1/(v1+v2))-li<=0)
		break;
}
cout<<i+1<<endl;
}
}

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=0,sp[2];
double  c1,c2,t;
int main(void){
	int a;
	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])){
		for(a=1;a<=10;a++)railal+=rail[a];
		c1=(double)sp[0]/3600;
		c2=(double)sp[1]/3600;
		for(a=1;a<=10;a++){
			t+=(double)rail[a]/c1;
			if((double)t*(sp[0]+sp[1])/3600>=railal){
				cout << a << endl;
				break;
			}
		}
	}
	return 0;
}