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

int main() {
	int ar[12];
	char c[11];
	for (int i = 0; i < 12; i++) {
		cin >> ar[i];
		cin >> c[i];

	}
	int dis=0;
	for (int i = 0; i < 10; i++) {
		dis += ar[i];
	}
	int speed = ar[10] + ar[11];
	double a = dis / speed;
	int j = 0;
	while (1) {
		a -= ar[j];
		if (a <= 0) {
			break;
		}
		j++;
	}
	cout << j << endl;

}

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

int main() {
	int ar[12];
	int dis=0;
	int speed;
	int x=0;
	while (1) {
		for (int i = 0; i < 12; i++) {
			scanf("%d,", &ar[i]);
		}
		if (ar[0] == EOF) {	break;}
		for (int i = 0; i < 10; i++) { dis += ar[i]; }
		int speed = ar[10] + ar[11];
		int a = (dis + speed - 1) / speed;
		while (1) {
			if (a - ar[x] < 0) { break; }
			a -= ar[x];
			x++;
		}
		cout << x << endl;
	}
	return 0;
}

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
using namespace std;
int main(){
  int in[10];
  int p;
  while(cin>>p){
    in[0]=p*100;
    int a,b;
    int suma=0,sumb;
    char d;
    cin>>d;
    int sum=in[0];
    loop(i,1,10){
      int tmp;
      cin>>tmp;
      in[i]=tmp*100;
      sum+=in[i];
      cin>>d;
    }
    cin>>a>>d>>b;
    sumb=sum;
    int i;
    cout<<suma<<" "<<sumb<<endl;
    for(i=0;sumb>suma;i++){
      suma+=in[i];
      sumb-=((in[i]/a)*b);
    }
    cout<<i<<endl;
  }
}

C++: #include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>

using namespace std;

int main(){
  int *a = new int[10];
  char c;
  while(true){
    int dis=0;
    for(int i=0;i<10;i++){
      cin >> a[i] >> c;
      dis += a[i];
    }
    
    int v1, v2;
    cin >> v1 >> c >> v2;

    // cout << v1 << " " << v2 << " " << dis << endl;
    
    float vall = v1 + v2;
    float t = dis/vall;
    float res = ((float)v1)*t;
    int tmp = 0;
    int i;
    for(i=0;i<10;i++){
      tmp += a[i];
      if(res <= tmp){
	break;
      }
    }
    cout << i+1 << endl;
  }

  
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.rl", "r", stdin);
	string str = "";
	
	while (getline (cin, str ) ){
		if (str.empty() ){
			break;
		} // end if

		vector <double> Area(11, 0. );
		vector <double> Sum (11, 0.);
		int i;

		while (str.find(',') != string::npos ){
			str = str.replace(str.find(','), 1, " ");
		} // end while

		stringstream ss(str);

		Area[0] = 0.;

		for (i = 1; i <= 10; ++i){
			ss >> Area[i];
		} // end for

		for (i = 0; i <= 10; ++i){
			Sum[i] = accumulate (Area.begin(), Area.begin()+i+1, 0.);
//			cout << "Sum[" << i << "]: " << Sum[i] << endl;
		} // end for
		
		double v1 = 0., v2 = 0.;
		ss >> v1;
		ss >> v2;
		double L = v1*Sum[10]/(v1 + v2);

		for (i = 1; i <= 10; ++i){
			if (Sum[i-1] < L && L <= Sum[i]){
				cout << i << endl;
				break;
			} // end if
		} // end for
	} // end while

	return 0;
}

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

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

  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) != EOF){
    len = 0;
    for (int i = 0; i < 10; i++){
      len += l[i];
    }
    double t = (double)len / (v1 + v2);
    double d = (double)v1 * t;
    len = 0;
    for (int i = 0; i < 10; i++){
      len += l[i];
      if (d <= len){
        cout << i + 1 << endl;
        break;
      }
    }
  }
}

C++: //AOJ 0034

#include<iostream>

using namespace std;

int main(){

	int l[10];
	int v[2];
	char tmp;
	int sum;
	double x;

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

		sum = 0;
		for(int i=0;i<10;i++){
			sum+=l[i];
		}
		x = sum * v[0]/(v[0]+v[1]);

		sum = 0;
		int cnt = 0;
		for(int i=0;i<10;i++){
			sum+=l[i];
			cnt++;
			if(sum>=x){
				cout<<cnt;
				break;
			}
		}
	}
	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-=a[i];
}
printf("%d\n",i+1);
}
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];
  while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2)){
  double sum = 0;
  rep(i,10){
    sum += l[i];
  }
  double sum2 = 0;
  v1=(v1/(v1+v2))*sum;
  rep(i,10){
    sum2+=l[i];
    if(v1 < sum2){
      cout << i << endl;
      break;
    }
  }
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
 
#define REP(i,b,n) for(int i=b;i<n;++i)
#define REPR(i,b,n) for(int i=n-1;i>=b;--i)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#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 BIT(n, b) ((n>>b) & 1)
#define PI acos(-1.0)

using namespace std;

static const double EPS = 1e-9;
typedef pair<int, int> pii;
typedef long long ll;

double l[11]={0}, v1, v2;

int solve(){
	
	double r = v1/(v1+v2);
	double x = r*l[10];
	
	for(int i=1; i <= 10; ++i){
		if( l[i-1] < x && x - l[i] <= EPS )
			return i;
	}
	
	return 10;
}
	

int main(){
		
	while(!cin.eof()){
		
		char c;
		
		for(int i=1; i<=10; ++i){
		
			cin >> l[i] >> c;
			l[i]+=l[i-1];
		}
		
		cin >> v1 >> c >> v2; 
		
		cout << solve() << endl;
	}
		
	return 0;
}

C++: #include <stdio.h>

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