#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> cars = {1,1,0,0,1,1,1,1,1,1,1,0,1};
int i = 0,count = 0;
while (i<cars.size()){
if (cars[i]==1) {
count++;
int k = 0;
while (k++<3 && cars[i]==1) i++;
} else{
i++;
}
}
cout<<count<<endl;
return 0;
}
停车场车辆统计
最新推荐文章于 2024-08-06 10:22:43 发布