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 <cstdio>
int main(){
int l[11],v1,v2;for(;~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);printf("%d\n",i+1))for(int i=0;i<10;i++){l[i]+=l[i-1];if(l[i]>=l[9]*(v1/((double)v1+v2)))break;}}}

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

/** Problem0034 : Railway Lines **/
int main()
{
	double l[10], v1, v2, total, totalL; char camma;
	double t;
	
	while (1) {
		total = 0; totalL=0;
		for (int i=0; i<10; i++) {
			cin >> l[i];
			cin >> camma;
			totalL+=l[i];
		}
		
		
		cin >> v1 >> camma >> v2;
		if (cin.eof()) break;
		for (int i=0; i<10; i++) {
			total+=l[i];
			t = (double)l[i]/v1;
			total+=t*v2;
			if (total >= totalL) {
				cout << i+1 << endl;
				break;
			}
		}
	}
		return 0;
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <math.h>
#include <functional>
#include <algorithm>
#include <utility>
#include <numeric>

typedef long long Int; 
#pragma warning(disable : 4996)
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
#define REPS(a,i,n) for(int i = a ; i < n ; ++i)
using namespace std;



vector<Int> eki(10);
int main(){

	while (scanf("%lld,", &eki[0]) != EOF){
		REPS(1, i, 10){
			scanf("%lld,", &eki[i]);
		}
		double v1,v2;
		scanf("%lf,%lf", &v1, &v2);

		double rate = ((double)v1 / (v1 + v2));

		Int sum = accumulate(eki.begin(), eki.end(), 0);

		double k = sum*rate;

		int ans = 0;
		int ed = 0;
		for (; ed < k && ans < 10;ans++){
			ed += eki[ans];
		}

		cout << ans << endl;
	}

	return 0;
}

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

int l[10] = {}, v[2];

void input(string s) {
	int x = 0,n=0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] != ',') {
			n = n * 10 + s[i] - '0';
			continue;
		}
		if (x < 10) {
			l[x++] = n;
			n = 0;
		}
		else {
			v[0] = n;
			n = 0;
		}
	}
	v[1] = n;
}


int main() {
	string s;
	while (cin >> s) {
		int len = 0, x1 = 0;
		double x;
		input(s);
		for (int i = 0; i < 10; i++)
			len += l[i];
		x = (double)len * v[0] / (double)(v[0] + v[1]);
		for (int i = 0; i < 10; i++) {
			x1 += l[i];
			if (x1 >= x) {
				cout << i + 1 << endl;
				break;
			}
		}
	}
	return 0;
}

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

vector<string> split(const string &str, char delim){
  vector<string> res;
  size_t current = 0, found;
  while((found = str.find_first_of(delim, current)) != string::npos){
    res.push_back(string(str, current, found - current));
    current = found + 1;
  }
  res.push_back(string(str, current, str.size() - current));
  return res;
}

int main()
{
	string s;
	while(cin >> s)
	{
		vector<string> _s = split(s,',');
		int *values = new int[11];
		double *v = new double[2];

		for(int i=0;i<11;i++)
		{
			if(i == 0)
			{
				values[i] = 0;
			}
			else
			{
				values[i] = atoi(_s[i-1].c_str()) + values[i-1];
			}
			
		}

		for(int i=0;i<2;i++)
		{
			v[i] = atoi(_s[i+10].c_str());
		}
		double temp = v[0] / (v[0]+v[1]);
		temp *= values[10];

		bool flag = true;
		for(int i=0;i<10;i++)
		{
			if(values[i] <= temp && temp <= values[i+1] && flag)
			{
				cout << i+1 << endl;
				flag = false;
			}
		}
	}
	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <queue>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
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();}

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

//typedef
//------------------------------------------
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;

//container util
//------------------------------------------
#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())

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

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

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

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

int gcd(int a, int b){
   int tmp;
   while(a%b==0){
      tmp=a%b;
      a=b;
      b=tmp;
   }
}

int lcm(int a,int b){
   return a*b/gcd(a,b);
}

bool prime_number(int n){
   if(n < 2){
      return false;
   }
   else if(n == 2){
      return true;
   }
   if(n % 2 == 0){
      return false;
   }
   for(int i=3;i<=n/i;i+=2){
      if(n % i == 0) return false;
      return true;
   }
}

int main(){
   vector<int> l(10),v(2);
   double sum=0;
   char c;
      
   while(cin >> l[0] >> c){
      FOR(i,1,10) cin >> l[i] >> c;
      cin >> v[0] >> c >> v[1];
      sum=accumulate(ALL(l),0);
      sum = sum*v[0]/(v[0]+v[1]);
      REP(i,10){
         sum-=l[i];
         if(sum<=0){
            cout << i+1 << endl;
            break;
         }
      }
   }
   
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>

using namespace std;

int main () {
    double b[10];
    double v1,v2;
    
    while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&b[0],&b[1],&b[2],&b[3],&b[4],&b[5],&b[6],&b[7],&b[8],&b[9],&v1,&v2)!=EOF){
        double l = b[0]+b[1]+b[2]+b[3]+b[4]+b[5]+b[6]+b[7]+b[8]+b[9];
        double t = l/(v1+v2);
        double l1 = t*v1;
        for(int i=0; i<10; i++){
            l1-=b[i];
            if(l1<=0){
                cout<<i+1<<endl;
                break;
            }
        }
    }
    return 0;
}