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++: //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<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
double a[15],b;
char ch;
signed main(void){
	while(scanf("%d,",&a[1])!=EOF){
		for(int i=2;i<12;i++)
			scanf("%d,",&a[i]);
		scanf("%d",&a[12]);
		b=0;
		for(int i=1;i<=10;i++)
			b+=a[i];
		b=(b*a[11])/(a[11]+a[12]);
		for(int i=1;i<=10;i++){
			b-=a[i];
			if(b<=0){
				printf("%d\n",i);
				break;	
			}
		}
	}
}

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

const double EPS = 1.0e-6;
int main()
{
	int l[10];
	int v1,v2;
	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) > 0){
		int suml = 0;
		for(int i=0; i<10; i++){
			suml += l[i];
		}
		double time = 1.0*suml / (v1+v2);
		double miti = time*v1 - EPS;
		int ans = 0;
		for(int i=0, sl=0; i<10+1; i++){
			if(miti < sl){
				ans = i;
				break;
			}
			sl += l[i];
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>

using namespace std;

int main() {
	vector<double> length(10);
	double v1, v2;
	char comma;

	while (cin >> length[0]) {
		for (int i = 1;i <= 9;i++) {
			cin >> comma >> length[i];
		}
		cin >> comma >> v1 >> comma >> v2;

		double total = 0;
		for (int i = 0;i < 10;i++) {
			total += length[i];
		}

		double hit = total / (v1 + v2) * v1;

		for (int i = 0;i < 10;i++) {
			hit -= length[i];
			if (hit <= 0) {
				cout << i + 1 << endl;
				break;
			}
		}
	}

	return 0;
}

C++: #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<double>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int a;
    while(cin>>a){
        vi range; range.push_back(a);
        ll sum=0; sum+=a;
        rep(i,10){if(i){int gotiusa; cin>>gotiusa; range.push_back(gotiusa);sum+=gotiusa;}char gomi; cin>>gomi;}
        double v; cin>>v; v/=10; char gomi; cin>>gomi;
        double u; cin>>u; u/=10;
        double tiya=u,rize=v;
        bool touch=false;
        for(int i=0;;i++){
            if(v+u-(double)sum>=0)touch=true;
            if(touch)break;
            v+=tiya;u+=rize;
        }
        rep(i,range.size()){
            v-=range[i];
            if(v<=0){cout<<i+1<<endl; break;}
        }
    }
}

C++: #include<stdio.h>

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

	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&m[0],&m[1],&m[2],&m[3],&m[4],&m[5],&m[6],&m[7],&m[8],&m[9],&v1,&v2)!=EOF)
	{
		int max=0;
		for(int x=0;x<10;x++)
		{
			max+=m[x];
		}
		printf("a");

		double half;
		half=max*v1/(v1+v2);

		for(int x=0;x<10;x++)
		{
			printf("b");
			if(half>m[x])
			{
				half-=m[x];
			}
			else if(half<=m[x])
			{
				
				printf("%d\n",(x+1));
				x=10;
			}
		}
	}
}

C++: 
#include<iostream>
using namespace std;
int main(){
		
	int km[10],v1,v2; char a;
    double leng;
	while(1){
	if(cin.eof()) break;
	for(int i=0;i<10;i++)
	cin >> km[i] >> a ;
	cin >> v1 >> a >> v2;	
	leng = 0.0;
	for(int k =0;k<10;k++)
	leng += km[k]; 
	double length = leng * v1 / (v1 +v2); 
	leng = 0.0;  
	for(int k=0;k<10;k++){
	leng +=  km[k];
	if(leng >= length ){
	
	cout << k+1 <<endl; break;
	}
	}	
	}
}

C++: #include <stdio.h>


int main(){
	int k[12], v1, v2, x;
	double h, d;

	while( scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
	&k[1],&k[2],&k[3],&k[4],&k[5],&k[6],&k[7],&k[8],&k[9],&k[10],&v1,&v2) != EOF ){

		x = 0;
		for(int i=1 ; i<=10 ; i++){
			x += k[i];
		}
		h = (double)x/(v1+v2);
		d = (double)v1*h;
		x = 0;
		for(int i=1 ; i<=10 ; i++){
			x += k[i];
			if( d <= x ){
				printf("%d\n", i);
				break;
			}
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
double d[15];
int main() {
	double l[15],v[5];
	char c[15];
	double x=0.0,y;
	int ans;
	while(true){
		cin>>l[0]>>c[0]>>l[1]>>c[1]>>l[2]>>c[2]>>l[3];
		cin>>c[3]>>l[4]>>c[4]>>l[5]>>c[5]>>l[6]>>c[6];
		cin>>l[7]>>c[7]>>l[8]>>c[8]>>l[9]>>c[9]>>v[0];
		cin>>c[10]>>v[1];
		if (cin.eof())break;
		x=0.0;
		for(int i=0;i<=9;i++){
			x+=l[i];
		}
		for(int i=1;i<=10;i++){
			d[i]=0.0;
		}
		double t;
		t=x/(v[0]+v[1]);
		y=v[0]*t;
		for(int i=1;i<=10;i++){
			for(int j=0;j<i;j++){
				d[i]+=l[j];
			}
		}
		for(int i=1;i<=10;i++){
			if(y<=d[i]){
				ans=i;
				break;
			}
		}
		cout<<ans<<endl;
	}
}

C++: #include<stdio.h>
#include<string.h>

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