#include <stdio.h>
int main(){
int n,score=0,step=1;
scanf("%d",&n);
while(n!=0){
if(n==1){
score+=1;
step=1;
}
else{
score+=step*2;
step++;
}
scanf("%d",&n);
}
printf("%d\n",score);
return 0;
}
CCF-跳一跳(201803-1)-C语言(100分)
最新推荐文章于 2023-12-21 14:30:04 发布