代碼(2)
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
int s,sun,r;
int x[9]
while(x[9]!=0)
{
cin>>s
switch(s)
{
base: 1
if(sun>=1)
{
sun--;
x[r]=x[r]-1;
if(x[r]<=0)
{
r++;
}
}
break;
base: 2
{
sun++;
}
}
}
}
標(biāo)簽: