#include <iostream>
using namespace std;
int main()
{
int n;
int lastscore = 0; //上一次得分(只是一次的)
int nowscore = 0; //当前总计得分
while(1)
{
int t;
cin>>t;
if(t == 0) break;
if(t == 1) lastscore = 1, nowscore += 1;
else if(t == 2 && lastscore <= 1)
lastscore = 2, nowscore += lastscore;
else
lastscore += 2, nowscore += lastscore;
}
cout<<nowscore;
return 0;
}
CCF 201803-1 跳一跳
最新推荐文章于 2020-12-07 10:53:48 发布