#include<iostream>
using namespace std;
int main() {
int n;
cout << "请输入有多少个学生:";
cin >> n;
bool* a = new bool[n]();
int num = 0, time=0;
bool* five = a;
while (1)
{
for (int i = 0; i < n; i++) {
if(a[i]==0)
time++;
if (time == 5) {
num++;
time = 0;
*(five+i) = 1;
}
if (num == n - 1)
break;
}
five = a;
if (num == n - 1)
break;
}
for (int i = 0; i < n; i++) {
if (*(five+i) == 0) {
cout << "结果为:第" << i + 1<<"个同学";
break;
}
}
}