Run ID:152092
提交时间:2026-04-19 15:34:25
#include<iostream> using namespace std; int a[31]; int main() { //记录标记的位置(放萝卜的位置) int cnt = 0; int k = 0; int i = 0; while (cnt < 15) { i++; if (a[i] == 0) { k++; } if (k == 9) { //标记的位置 a[i] = 1; cnt++; k=0; } if (i == 30) { i = 0; } } for (int j = 1;j <= 30;j++) { if (a[j] == 0) { cout<<j<<" "; } } }