#include <cstdio>
#include <iostream>
using namespace std;
int getIndex(int arr[], int n){
int residue = n;
int i = 0, cur = 0;
while(residue > 1){
if(arr[i] == 0){
cur++;
}
if(cur == 3){
arr[i] = 1;
residue--;
cur = 0;
}
i++;
if(i >=n ){
i = 0;
}
}
while (arr[i] != 0)
{
i++;
if(i >=n ){
i = 0;
}
}
return i;
}
int main() {
int n;
while(~scanf("%d", &n)){
if(n > 1000) n = 1000;
int arr[
华为2016研发工程师编程题
最新推荐文章于 2024-07-26 14:07:59 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)