#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分)
猜你喜欢
转载自blog.csdn.net/qq_40825479/article/details/105529270
今日推荐
周排行