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;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};

int main() {
  int l[10], 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) {
    int sum = 0;
    double time = 0;

    REP(i, 10) sum += l[i];
    time = (double)sum / (v[0]+v[1]);
    double len = v[0] * time;
    REP(i, 10) {
      len -= l[i];
      if(len <= 0) {
	cout << i+1 << endl;
	break;
      }
    }
  }
}

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

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

	while (cin >> a[0] >> c >> a[1] >> c >> a[2] >> c >> a[3] >> c 
				>> a[4] >> c >> a[5] >> c >> a[6] >> c >> a[7] >> c 
				>> a[8] >> c >> a[9] >> c >> v1 >> c >> v2) {
		
		int s = 0;

		for (int i = 0; i < 10; i++)
			s += a[i];

		double u = (double)(s * v1) / (double)(v1 + v2);

		int j = 0;

		while (u > 0) {
			u -= a[j];
			j++;
		}

		cout << j << endl;
	}

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }


vector<string> split(string str, string delim)
{
    vector<string> result;
    int cutAt;
    while( (cutAt = str.find_first_of(delim)) != str.npos )
    {
        if(cutAt > 0)
        {
            result.push_back(str.substr(0, cutAt));
        }
        str = str.substr(cutAt + 1);
    }
    if(str.length() > 0)
    {
        result.push_back(str);
    }
	return result;
}


int main()
{
	vint line(10);
	float v1, v2;

	while(1)
	{
		string str;
		getline(cin, str);
		if(cin.eof()) break;

		vector<string> ss = split(str, ",");

		rep(i, 10)
		{
			line[i] = 0;
			rep(j, ss[i].size())
			{
				line[i] += pow((double)10, (double)ss[i].size() - j -1) * (ss[i][j] - '0');
			}
		}

		v1 = v2 = 0;

		rep(j, ss[10].size())
			v1 += pow((double)10, (double)ss[10].size() - j -1) * (ss[10][j] - '0');
		rep(j, ss[10].size())
			v2 += pow((double)10, (double)ss[11].size() - j -1) * (ss[11][j] - '0');


		float sum = accumulate(ALL(line), 0);

		float cross = sum / (v1 + v2) * v1;

		partial_sum(ALL(line), line.begin());

		rep(i, 10)
			if(cross <= line[i])
			{
				cout << i + 1 << endl;
				return 0;
			}
	}
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;

int main() {
	int l[11];
	char c;
	for(; cin >> l[1] >> c; ) {
		rep(i, 9) cin >> l[i + 2] >> c;
		l[0] = 0;
		int v1, v2; cin >> v1 >> c >> v2;
		rep(i, 10) l[i + 1] += l[i];
		double x = l[10] / (double)(v1 + v2) * v1;
		rep(i, 10) if(l[i] <= x && x <= l[i + 1]) {
			cout << i + 1 << endl;
			break;
		}
	}
	return 0;
}

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

int l[11],v1,v2;
double sum,a;


int main(){
	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){
		sum=l[1]+l[2]+l[3]+l[4]+l[5]+l[6]+l[7]+l[8]+l[9]+l[10];
		a=sum*v1/(v1+v2);
		for(int i=1;i<11;i++){
			if(a>l[i]) a-=l[i];
			else {
				printf("%d\n",i);
				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.01){
	n1=v1*i,n2=sum-v2*i;
	if(abs(n1-n2)<=0.01){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 <cstdlib>
#include <numeric>

using namespace std;

int main() {
  char *line = NULL;
  size_t buffer_size = 0;
  while (getline(&line, &buffer_size, stdin) > 0) {
    int ls[10];
    int v1, v2;
    sscanf(line, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
           ls, ls+1, ls+2, ls+3, ls+4, ls+5, ls+6, ls+7, ls+8, ls+9,
           &v1, &v2);
    int total_len = accumulate(ls, ls + 10, 0);
    double x1 = v1 * static_cast<double>(total_len) / (v1 + v2);
    for (int i = 0, acc = 0; i < 10; ++i) {
      acc += ls[i];
      if (x1 <= acc) {
        printf("%d\n", i + 1);
        break;
      }
    }
  }
  free(line);

  return 0;
}