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<bits/stdc++.h>
using namespace std;
int main()
{
    int dis[11],up,down,sum;
    char s;
    while(cin>>dis[1]>>s){
        sum=dis[1];
        for(int i=2;i<=10;i++){
                cin>>dis[i]>>s;
                sum+=dis[i];
        }
        cin>>up>>s>>down;
        double sec,spead=up+down;
        sec=(sum/spead)*up;
       // cout<<sec<<endl;
        for(int i=1;i<11;i++){
            sec-=dis[i];
            if(sec<=0){
                cout<<i<<endl;
                break;
            }
        }
    }
}

C++: #include<cstdio>
#include<algorithm>
#include<numeric>
using namespace std;
int main(){
  int l[10], v1, v2, ret;
  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],&v1,&v2)){
    int sum = accumulate( l, l + 10, 0), k = 0;
    double ret = ((double)v1 / ( v1 + v2)) * sum;
    for(int i = 0 ; i < 10 ; i++ ){
      if( (k += l[i]) >= ret ){
        printf("%d\n", i+1);
        break;
      }
    }
  }
}

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

int main() {
  int a[10], v1, v2,i;
  while(scanf("%d%*c%d%*c%d%*c%d%*c%d%*c%d%*c%d%*c%d%*c%d%*c%d%*c%d%*c%d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&v1,&v2)==12) {
    int sum=0,nv1,nv2;
    for(i=0; i<10; i++) sum+=a[i];
    nv1=nv2=0;
    sum*=100;
    while(sum>nv1+nv2) {
      nv1+=v1;
      nv2+=v2;
    }
    sum=0;
    for(i=0; i<10; i++) {
      if(sum>=nv1) break;
      sum+=a[i]*100;
    }
    cout << i << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

typedef long long ll;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }



#define MAX 10

int main() {
	vci dist(MAX);
	int vi, vj; char c;
	
	while (cin >> dist[0]) {
		for_(i, 1, MAX) {
			int d;
			cin>>c>>d;
			dist[i] = dist[i-1] + d;
		}
		cin >>c>> vi>>c >> vj;
		
		double lb = 0.0, rb = (double)dist[MAX-1]/(double)max(vi,vj);
		while (rb-lb>1e-9) {
			double mb = (lb+rb)/2.;			
			double pi = (double)vi*mb, pj = (double)dist[MAX-1] - (double)vj*mb;
			
			if (pi==pj) { lb = mb; break; }
			if (pi < pj) lb = mb;
			else rb = mb;
		}
		
		double p = vi*lb;
		for_(i, 0, MAX) if ((double)dist[i]>=p) {
			cout << i+1 << endl; break;
		}
	}	
	
	return 0;
}

C++: #include <cstdio>
using namespace std;
int main(int argc, char *argv[]) {
	int l[10], v1, v2;
	while (EOF != 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],&v1,&v2)) {
		// sum
		int sum = 0;
		for (int i=0;i<10;i++) sum+=l[i];
		// 1's length
		float ans = (float)(sum)*(float)(v1)/(float)(v1+v2);
		//printf("%f\n",ans);
		// calc
		int tmp = 0;
		for (int i = 0; i < 10; i++) {
			tmp += l[i];
			if (ans <= tmp) {
				printf("%d\n",i+1);
				break;
			}
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
const int INF=1111111111;
int main(){

int ta[10],v1,v2,sum=0;
double t,n1,n2;
while(true){
for(int i=0;i<10;i++){cin>>ta[i];cin.ignore();sum+=ta[i];}
char tmp;
if(!(cin>>v1>>tmp>>v2))break;
for(double i=0.0;;i+=0.001){
	n1=v1*i,n2=sum-v2*i;
	if(abs(n1-n2)<=0.001){t=i;break;}
}
sum=0;
for(int i=0;i<10;i++){;
	if(v1*t<(double)sum){cout<<i<<endl;break;}
	sum+=ta[i];
}
}
return 0;
}

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

int main()
{
    float l[11];
    float v1,v2;

    scanf("%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f",
            &l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&l[10],
            &v1,&v2);
    
    float t,la;
    float lsum=0;
    for(int i=1;i<=10;++i){
        lsum+= l[i];
    }
    
    t = lsum/(v1+v2);
    la = v1*t;
    lsum = 0;
    for(int i=1;i<10;i++)
    {
        lsum += l[i];
        if(lsum >= la){ cout << i << endl; break;}
    }
    if(lsum < la)cout << 10 << endl;


    return 0;
}

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

int main(){
	double l[10], t[10], a, b;
	char c;
	while(cin >> l[0] >> c){
		t[0] = l[0];
		for(int i = 1;i< 10;i++){cin >> l[i] >> c;t[i] = t[i-1] + l[i];}
		cin >> a >> c >> b;
		double tmp = t[9]/(a+b)*a;
		int ans = 1;
		while(tmp > t[ans-1]){
			ans++;
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main(){
	int l[10], v0, v1;
	string in;
	while( cin >> in ){
		sscanf( in.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],&v0,&v1 );
		int sum=0;
		for( int i=0; i<10; i++ ){
			sum += l[i];
		}
		double t = (double)sum / (double)(v0+v1);
		double len = t * v0;
		int i=0;
		for(; i<10; i++ ){
			len -= l[i];
			if( len <= 0.0 )	break;
		}
		cout << i+1 << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <stdlib.h>
#include <string>
#include <sstream>
#include <vector>

int main(void){

	std::string input;

	while(std::cin >> input){
		std::vector<int> Station;

		std::stringstream ss(input);
		std::string buffer;
		while(std::getline(ss, buffer, ',')){
			Station.push_back(atoi(buffer.c_str()));
		}
		double Va = Station[Station.size()-2];
		double Vb = Station[Station.size()-1];

		double ratio = Va / (Va + Vb);

		double distance = 0.0;
		for(unsigned int i=0; i<Station.size()-2; i++){
			distance += Station[i];
		}
		double position = distance * ratio;

		for(unsigned int i=0; i<Station.size()-2; i++){
			position -= Station[i];
			if(position <= 0.0){
				std::cout << i+1 << std::endl;
				break;
			}
		}
	}

	return 0;
}

C++: #include <cstdio>

using namespace std;

int main(void){
	int i,l[10],v1,v2, sum;
	double t, dist;
	while(scanf("%d%*c",&l[0]) != EOF){
		sum = l[0];
		for(i = 1;i < 10;i++){
			scanf("%d%*c",&l[i]);
			sum += l[i];
		}
		scanf("%d%*c%d",&v1,&v2);
		t = (double)sum / (v1 + v2);
		dist = v1 * t;
		sum = 0;
		for(i = 0;sum < dist && i < 10;i++){
			sum += l[i];
		}
		printf("%d\n",i);
	}
	return 0;
}