#include <stdio.h>
int main(){
int n, a[10], i;
while(scanf("%d", &n) == 1){
for(i = 0; i != 10; ++i)
scanf("%d", &a[i]);
for(i = 0; i != 10; ++i){
if(n == 0) break;
n += a[i];
}
printf("%d\n", i);;
}
return 0;
}
转载于:https://www.cnblogs.com/changmu/p/3639785.html