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<stdio.h>
#include<iostream>
using namespace std;

int main()
{

int num[11]={};
int x,t,T=0;
double S1=0,S2=0,V1,V2,W;
bool f1=false,f2=false;
while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",&num[0],&num[1],&num[2],&num[3],&num[4],&num[5],&num[6],&num[7],&num[8],&num[9],&V1,&V2)!=EOF){
/*
for(int i=1;i<10;i++)
{scanf("%d",&x);num[i]=x;}
cin>>V1>>V2;
*/W=0;S1=0;S2=0;
for(int i=0;i<10;i++)
S1+=num[i];
for(int i=0;i<10;i++)
S2=V1+V2;
t=0;T=0;
W=S1*V1/S2;
//cout<<S1<<" "<<S2<<" "<<W<<" ";
do{

T+=num[t];
if(T==W)f1=true;
t++;
}while(T<W);
if(f1==false)printf("%d\n",t);
else if(f1==true)printf("%d\n",t);
}
return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

typedef long long ll;
using namespace std;

typedef pair<int,int> P;

void seek_lcs(int a,int b,int dp[10+1][10+1],int* num,int* base,vector<int>& idx){
	if(a==0 || b==0){
		return;
	}

	if(num[a] == base[b]){
		seek_lcs(a-1,b-1,dp,num,base,idx);
		idx.push_back(num[a]);
	}
	else{
		if(dp[a-1][b] >= dp[a][b-1]){
			seek_lcs(a-1,b,dp,num,base,idx);
		}
		else{
			seek_lcs(a,b-1,dp,num,base,idx);
		}
	}

}

int main()
{
	int T;
	int l[10];
	int v1,v2;
	while(~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
		l,l+1,l+2,l+3,l+4,l+5,l+6,l+7,l+8,l+9,&v1,&v2)){
			double lb=0.0;
			double ub=1000000000;

			int sum = 0;
			for(int i=0;i<10;i++) sum+=l[i];
			for(int i=0;i<100;i++){
				double md = (ub+lb)/2.0;
				if((md/3600.0)*v1 +(md/3600.0)*v2 > sum) ub = md;
				if((md/3600.0)*v1 +(md/3600.0)*v2 < sum) lb = md;
			}

			double dist_t = v1*lb/3600.0;

			double dist_l = 0;
			for(int i=0;i<10;i++){
				dist_l += (double)l[i];
				if(dist_l >= dist_t){
					cout << i+1 << endl;
					break;
				}
			}
			//printf("%f\n",ub);
			//printf("%f\n",lb);
	}
}

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

using namespace std;

int l[10];
int a, b, sum;

int main()
{
    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)) {
        for (int i = 1; i < 10; ++i) l[i] += l[i - 1];
        double c = ((double)l[9] / (a + b)) * a;
        for (int i = 9; i >= 0; --i) if (c >= l[i]) { printf("%d\n", i + (c > l[i])); break; }
    }
}

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

int main(void){
	int l[10];
	char c;
	double ls, x1, x2, v1, v2;
	while(!cin.eof()){
		ls = 0;
		for(int i = 0; i < 10; i++){
			cin >> l[i] >> c;
			ls += l[i];
		}
		cin >> v1 >> c >> v2;
		
		x1 = x2 = 0.0;
		int cnt = 0;
		while(x1 + x2 < ls){
			x1 += l[cnt];
			x2 += ((double)l[cnt] / v1) * v2;
			cnt++;
		}
		cout << cnt << endl;
	}
	return 0;
}

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



int main(){
	int l[10];
	int v[2];
	double m;
	double pos;
	int ans;
	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){
		m=0;
		for(int i=0;i<10;i++){
			m+=l[i];
		}
		pos=(m*v[0])/double(v[0]+v[1]);
		for(int i=0;i<10;i++){
			pos-=l[i];
			if(!(pos>0)){
				ans=i+1;
				break;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

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],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])){
		railal=0;
		t=0;
		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;
}

C++: #include <iostream>

using namespace std;

int main () {
  int l[10];
  int v1, v2;
  
  while (cin >> l[0]) {
    cin.ignore();
    for(int i = 1; i < 10; i++) {
      cin >> l[i];
      cin.ignore();
    }
    cin >> v1;
    cin.ignore();
    cin >> v2;

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

    double cross = 1.0 * v1 * l_total / (v1 + v2);
    
    int l_partsum = 0;
    for(int i = 0; i < 10; i++) {
      l_partsum += l[i];
      if(cross <= l_partsum){
        cout << i + 1 << endl;
        break;
      }
    }
  }
}

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>>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の動く距離
        cnt=0;
        while(d>0){
            d -= l[cnt];
            cnt++;
        }
        cout << cnt << endl;
    }
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int l[12];
int main(){
	while(scanf("%d",l)!=-1){
		double s = l[0];
		for(int i = 1 ; i < 12 ; i++){
			scanf(",%d",&l[i]);
			if( i < 10 ) s += l[i];
		}
		double a = l[10];
		double b = l[11];
		double x = 1.0 * s / (a+b) * a;
		int s2 = 0;
		for(int i = 0 ; i < 10 ; i++){
			if( s2 + l[i] > x - 1e-9 ){
				cout << i+1 << endl;
				break;
			}
			s2 += l[i];
		}
		
		
		

	}
	
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
	double l[10],v1,v2,x;
	double ans;
	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>>v1>>c>>v2){
		x=0;
		for(int i=0;i<10;i++){
			x+=l[i];
		}
		ans=x*v1/(v1+v2);
		int n=0,s=0;
		while(1){
			s+=l[n];
			if(ans<=s){
				cout<<n+1<<endl;
				break;
			}
			n++;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#define  rep(i,n) for(int i = 0 ; i < n ; i++ )
using namespace std;

int main(){
  double v1,v2;
  int l[10];
  double sum = 0;
  rep(i,10){
    scanf("%d,",&l[i]);
    sum += l[i];
  }
  scanf("%lf,%lf",&v1,&v2);
  double sum2 = 0;
  v1=(v1/(v1+v2))*sum;
  rep(i,10){
    sum2+=l[i];
    if(v1 < sum2){
      cout << i << endl;
      break;
    }
  }
  return 0;
}