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 <cstdio>
#include <iostream>

using namespace std;

int main(void) {
    int w[10], v1, v2;
    while (scanf("%d,", w) != EOF) {
        for (int i = 1; i < 10; i++) scanf("%d,", w + i);
        scanf("%d,%d", &v1, &v2);
        int sum = 0;
        for (int i = 0; i < 10; i++) sum += w[i];
        double x = (double)(sum * v1) / (v1 + v2);
        for (int i = 0; i < 10; i++) {
            x -= w[i];
            if (x <= 0.01) {
                cout << i + 1 << endl;
                break;
            }
        }
    }
    return 0;
}

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

#define SIZE 10

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

			if (i == 0) continue;
			l[i] += l[i - 1];
		}
		cin >> v1 >> t >> v2;
		s = (double)l[SIZE - 1] / (v1 + v2);

		for (int i = 0; i < SIZE; i++) {
			if (l[i] >= s * v1) {
				cout << i + 1 << endl;
				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 <stdio.h>

int main()
{
	while (true)
	{
		int d[10];
		int va, vb;
		int sumd = 0;

		for (int i = 0; i < 10; i++)
		{
			if (scanf("%d,", &d[i]) == -1) return 0;
			sumd += d[i];
		}
		scanf("%d,%d", &va, &vb);

		double p = double(sumd) / double(va + vb) * double(va);
		int ans = 0;
		while (p > 0)
		{
			p -= d[ans];
			ans++;
		}

		printf("%d\n", ans);
	}

	return 0;
}