跳一跳201803-1
作者:互联网
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int sum=0;
int point=0;
while(n!=0)
{
if(n==2)
point+=2;
else
point=0;
switch(n){
case 1:sum+=1;break;
case 2:sum+=point;
}
cin>>n;
}
cout<<sum<<endl;
return 0;
}
标签:case,std,point,int,sum,cin,201803 来源: https://www.cnblogs.com/WuDie/p/11287926.html