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

int main() {
	int dis[10];
	int v[2];

	while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &dis[0], &dis[1], &dis[2], &dis[3], &dis[4], &dis[5], &dis[6], &dis[7], &dis[8], &dis[9], &v[0], &v[1]) != EOF) {
		double total_dis = 0.0;
			for (int i = 0; i < 10; i++) {
				total_dis += static_cast<double>(dis[i]);
			}
			double meet_time = total_dis / (v[0] + v[1]);
			double meet_dis = meet_time*v[0];
			double passed_dis = 0;
			for (int i = 0;; i++) {
				passed_dis += static_cast<double>(dis[i]);
				if (passed_dis == meet_dis) {
					cout << i+1 << endl;
					break;
				}
				if (passed_dis > meet_dis) {
					cout << i+1 << endl;
					break;
			}
		}
	}
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	string str;
	while(cin>>str){
		int l[12], j=0, sum=0;
		string s;
		for(int i=0; i<str.length(); i++){
			if(str[i]!=','){
				s+=str[i];
			}
			else{
				l[j]=stoi(s);
				j++;
				s="";
			}
		}
		l[j]=stoi(s);
		int v1=l[10], v2=l[11];
		for(j=0; j<10; j++)
			sum+=l[j];
		double s1=(double)v1*sum/(v1+v2);
		j=0;
		int long1=0;
		while(s1>=long1){
			long1+=l[j];
			j++;
		}		
		if(s1==long1-l[j])
			cout<<j-1<<endl;
		else
			cout<<j<<endl;

	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int len[10];
  int v1,v2;
  int i,j;

  while(scanf(" %d",&len[0])!=EOF){
    int lensum=len[0];
    for(i=1;i<10;i++){
      scanf(",%d",&len[i]);
      lensum+=len[i];
    }
    scanf(",%d,%d",&v1,&v2);
    int ratio=v1+v2;
    double place=(lensum*v1*1.0)/ratio; //?????????????????????
    rep(i,10){
      place-=len[i];
      if(place<=0){
	cout<<i+1<<endl;
	break;
      }
    }
  }
}

C++: #include<iostream>
#include<stdio.h>
#include<vector>
int main(){
  int dis[10];int speed[2];vector<int> answers;
  while(scanf("%d,%d,%d,%d,%d,%d.%d,%d,%d,%d,%d,%d",&dis[0],&dis[1],&dis[2],&dis[3],&dis[4],&dis[5],&dis[6],&dis[7],&dis[8],&dis[9],&speed[0],&speed[1])!=EOF){
    int all=0;
    for(int i=0;i<10;i++){
      all+=dis[i];
    }
    double addtion_speed=speed[0]+speed[1];
    double same_time=all/addtion_spedd;
    double same_dis=speed[0]*same_time;
    double add_dis=0;
    int j=0;
    while(same_dis>add_dis){
      add_dis+=dis[j];
      j++;
    }
    if(same_dis==add_dis)j--;
    answers.push_back(j);
  }
  for(int i=0;i<answers.size();i++){
    cout<<answers[i]<<endl;
  }
}

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

int main()
{
	double l[10],v1,v2; char c;

	while(cin >> l[0])
	{
		double sl = l[0];
		for(int i=1; i<10; i++)
		{
			cin >> c >> l[i];
			sl += l[i];
		}

		cin >> c >> v1 >> c >> v2;


		double t = v1 / (v1+v2);

		double r = 0;
		for(int i=0; i<10; i++)
		{
			r += l[i];
			if(t < r/sl+1e-10)
			{
				cout << i+1 << endl;
				break;
			}
		}
	}
}

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

int main(void){ 
  string s;
  while(getline(cin,s)){
    vector<int> l;
    s+= ",";
    int n = 0 , lon = 0;;
    for(int i = 0 ; i < s.size() ; i ++){
      //cout<<n<<" ";
      if(s[i] ==','){
	l.push_back(n);
	lon += n;
        n = 0;
      }else{
	n = n * 10 + s[i] - '0';
      }
    }
    lon = lon - l[l.size() - 2] - l[l.size()-1];
    double per = l[l.size() - 2] + l[l.size()-1];
    per = l[l.size() - 2 ] / per * lon;
    /*
    cout<<"lon"<<lon<<endl;
    cout<<"per"<<per<<endl;
    //*/
    int nn=0;
    for(int i = 0 ; i < l.size() ; i ++){
      nn += l[i];
      //cout<<nn<<endl;
      if(nn>=per){
	//cout<<"res"<<++i<<endl;
	cout<<++i<<endl;
	break;
      }
    }
    //*/
  }
}

C++: #include <cstdio>
int main(){
	float l[10], v, w;
	while(~scanf("%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f",l,l+1,l+2,l+3,l+4,l+5,l+6,l+7,l+8,l+9,&v,&w)){
		int a = 0, r, d=0, i=0;
		for(;i<10;i++)d+=l[i];

		for(i=0;i<10;i++){
			a += l[i];
			if(d*v/(v+w) <= a){r = i + 1;break;}
		}
		printf("%d\n", r);
	}
}

C++: #include<iostream>
using namespace std;
int main(){
  char g;
  double len[11],total=0;
  double train1,train2;
  double a;
  while(1){
    total=0;
    for(int i=0;i<10;i++){
      cin >> len[i] >> g;
      total+=len[i];
    }
    cin >> train1 >> g >> train2;
    if(cin.eof()) break;
    a=total/(train1+train2);
    a*=train1;
    total=0;
    int i=0;
    while(a>total){
      total+=len[i];
      i++;
    }
    cout << i << endl;
  }
}

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

using namespace std;

int main(){
	int l[10],sum;
	double x,y;
	double v1,v2;
	while(scanf("%d",&l[0])!=EOF){
		sum=l[0];
		for(int i=1;i<10;i++){
			scanf(",%d",&l[i]);
			sum+=l[i];
		}
		printf("sum %d\n",sum);
		scanf(",%lf,%lf",&v1,&v2);
		x=(v1*sum)/(v1+v2);
		printf("x %lf\n",x);
		y=sum-x;
		int pass;
		double temp=0;
		for(int i=0;i<10;i++){
			temp+=l[i];
			if(temp>=x){
				pass=i;
				break;
			}
		}
		printf("%d\n",pass+1);
	}
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;

int pow(int a,int n){
	if(n <= 0){
		return 1;
	}
	return a * pow(a,n - 1);
}

int main(){
	int v1,v2;
	int a[10];
	int sum1;
	int sum2;
	int ans = 0;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&v1,&v2) != 0){
		sum1 = 0;
		sum2 = 0;
		for(int i = 0; i < 10; i++){
			sum1 += a[i];
		}
		for(int i = 0; i < 10; i++){
			sum2 += a[i];
			if(sum1 * v1 > sum2 * (v1 + v2)){
				ans = i + 2;
			}
		}
		printf("%d\n",ans);
	}
	///////////////////////////////////
	//Sleep(200000);///////////////////// 提出するときは必ず外す！
	///////////////////////////////////
	return 0;

}

C++: #include <stdio.h>
   
int main(){
double v1,v2,t,x;
int a[10],i;
while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&v1,&v2)!=EOF){
x=0;
for(i=0;i<10;i++){
x+=a[i];
}
t=(double)x/((double)v1+(double)v2)*(double)v1;
for(i=0;t>=0;i++){
t-=(double)a[i];
}
printf("%d\n",i-1);
}
return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
main(){
  int l[10];
  int v[2];
  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){
    double h;
    double k;
    int res;
    for(int i=0;i<10;i++){
      int j;
      k=0;
      for(j=0;j<=i;j++){
	k+=(double)l[j];
      }
      h=k/(double)v[0];
      k=h*v[1];
      double tk=0;
      for(j=9;j>=0;j--){
	tk+=(double)l[j];
	if(tk >= k) break;
      }
      // printf("%lf %lf   %d : %d\n",h,k,i,j);
      if(i > j){
	double th;
	for(j=9;j>=i;j--){
	  tk+=(double)l[j];
	}
	for(j=0;j<i;j++)
	  k+=(double)l[j];
	h=k/(double)v[0];
	th=tk/(double)v[1];
	//printf("%lf <> %lf : %d\n",th,h,i);
	if(th > h) res=i+1;
	else
	  res=i;
	break;
      }
    }
    printf("%d\n",res);
  }
}