#include <iostream>
using namespace std;
int main(){
int n;
int sum=0,temp=0;
while(cin>>n&&n){
sum=sum+n;
if(n==1) {
temp=0;
}
if(n==2){
sum=sum+temp;
temp+=2;
}
}
cout<<sum;
return 0;
}
201803-1 跳一跳
猜你喜欢
转载自blog.csdn.net/qq_42261362/article/details/83627275
今日推荐
周排行