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>
using namespace std;
int main(){
    int l[11]={0};
    char unk;
    while(scanf("%d",&l[1])!=EOF){
        scanf(" %c",&unk);
        for(int i = 2;i <= 10; i++)scanf("%d %c",&l[i],&unk);
        double v1,v2;
        scanf("%lf,%lf",&v1,&v2);

        double sum=0,a;
        for(int i = 1;i <= 10; i++)sum += (double)l[i];

        a = sum/(v1+v2)*v1;
        sum = 0;
        bool f = 0;
        for(int i = 1;i <= 10; i++){
            sum += l[i];
            if(a <= sum){
                printf("%d\n",i);
                f = 1;
            }
            if(f == 1)break;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int main() {
	double l[15],v[5],d=0.0;
	char c[15];
	double x=0.0,y;
	int ans;
	while(true){
		cin>>l[0]>>c[0]>>l[1]>>c[1]>>l[2]>>c[2]>>l[3];
		cin>>c[3]>>l[4]>>c[4]>>l[5]>>c[5]>>l[6]>>c[6];
		cin>>l[7]>>c[7]>>l[8]>>c[8]>>l[9]>>c[9]>>v[0];
		cin>>c[10]>>v[1];
		if (cin.eof())break;
		for(int i=0;i<=9;i++){
			x+=l[i];
		}
		double t;
		t=x/(v[0]+v[1]);
		y=v[0]*t;
		for(int i=0;i<=9;i++){
			d+=l[i];
			if(y<d){
				ans=i+1;
				break;
			}
			else if(y==d){
				ans=i;
				break;
			}
		}
		cout<<ans<<endl;
	}
}

C++: #include <stdio.h>

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

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	double a[10],n,m;
	char z;
	while(cin>>a[0]){
		double h=a[0];
		for(int i=1;i<10;i++){
			cin>>z>>a[i];
			h+=a[i];
		}
		cin>>z>>n>>z>>m;
		h=h*n/(n+m);
		int i=0,w=0;
		while(true){
			if(w>=h)
				break;
			w+=a[i];
			i++;
		}
		cout<<i<<endl;
	}
	return 0;
}

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

int main(){
	int first;
	while(std::cin>>first){
		std::vector<int> distance(10);
		distance[0]=first;
		int a=0;
		int sum=0;
		char dummy;
		sum+=first;
		for(int i=1;i<10;++i){
			std::cin>>dummy;
			int s;
			std::cin>>s;
			sum+=s;
			a+=s;
			distance[i]=a;
		}
		double v1,v2;
		std::cin>>dummy>>v1>>dummy>>v2;
		int ans=0;
		for(int i=9;i>=0;--i){
			if(distance[i]<=sum/(v1+v2)*v1){
				ans=i+1;
			}
		}
		std::cout<<ans<<std::endl;
	}
	return 0;
}

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

int main()
{
	int l[10], v1, v2, n, cnt;
	double d, t;
	char ch;
	while (cin>>l[0]>>ch){
		n = 0;
		for (int i = 1; i < 10; i++)
		{
		    cin >> l[i] >> ch;
		    n += l[i];
		}
		cin >> v1 >> ch >> v2;
		t=n/(v1+v2);
		d=v1*t;    //列車1の動く距離
		cnt=0;
		while(d>0){
		d -= l[cnt];
		cnt++;
		}
		cout << cnt << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
double l[11], a, b, sum, dis; char d;
int main() {
	while (cin >> l[1] >> d >> l[2] >> d >> l[3] >> d >> l[4] >> d >> l[5] >> d >> l[6] >> d >> l[7] >> d >> l[8] >> d >> l[9] >> d >> l[10] >> d >> a >> d >> b) {
		sum = 0;
		for (int i = 1; i <= 10; i++) {
			sum++;
		}
		dis = 1.0*sum*(a / (a + b));
		sum = 0;
		for (int i = 1; i <= 10; i++) {
			sum += l[i];
			if (sum >= dis) { cout << i << endl; break; }
		}
	}
}

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

int main(void){

    int l[10];
    int v1,v2;
    char c;


    while(cin >> l[0]){
        int sum = 0;
        int ans=0;
        sum= l[0];

        for(int i = 1;i < 10;i++){
            cin >> c >> l[i];
            sum+=l[i];
        }
        cin >> c >> v1 >> c >> v2;
        //cout << v1 << " " << v2 << endl;

        double ti = sum/double(v1+v2);
        double tmp = ti*double(v1);
        //cout << ti << " " << tmp << endl;

        for(int i = 0;i < 10;i++){
            tmp-=l[i];
            if(tmp<=0){
                ans=i+1;
                break;
            }

        }
        cout << ans << endl;

    }

   
    
    return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  double a[10],v[2];
  for(;;){
    if(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&v[0],&v[1]) == EOF) break;
    double x = 0;
    for(int i=0; i<10; i++) x+=a[i];
    x = x/(v[0]+v[1])*v[0];
    for(int i=0; i<10; i++){
      x-=a[i];
      if(x<0.0001){
	cout <<i+1<<endl;
	break;
      }
    }
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
main()
{
    int l[10],v1,v2;
    while(1){
        for(int i=0;i<10;i++)if(!~scanf("%d,",l+i))break;
        if(!~scanf("%d,%d",&v1,&v2))break;
        int s=0;
        for(int i=0;i<10;i++)s+=l[i];
        double p=v1*1.0/(v1+v2);
        double u=s*p,t=0;
        for(int i=0;i<10;i++)
        {
            t+=l[i];
            if(u<=t)
            {
                cout<<i+1<<endl;
                break;
            }
        }
    }
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

int main() {
	int v1,v2,ret;
	double h,sum=0;
	vector<int> l(10, 0);
	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) {
		for (int i=0; i<10; i++) {
			sum += l[i];
		}
		sum /= (v1+v2);
		sum *= v1;
		for (int i=0; i<10; i++) {
			sum -= l[i];
			if (sum <= 0) {
				ret = i+1;
				break;
			}
		}
		cout << ret << endl;
	}
	return 0;
}

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

using namespace std;

#define REP(i, n)       REPEAT(i, 0, n)
#define REPEAT(i, k, n) for (int i = (k); i < (n); ++i)

int main(){
    string s;
    while(getline(cin, s)){
        int l[10],v[2];
        sscanf(s.c_str(), "%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],&v[0],&v[1]); 

        int total = 0; REP(i,10) total += l[i];
        double d = (double)total * v[0] / (v[0]+v[1]);
        REP(i,10){
            if(d <= l[i]){
                cout << i+1 << endl;
                break;
            }
            d -= l[i];
        }
    }
    return 0;
}