Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
27680 | 唐心 | 报数模拟 | C++ | Accepted | 2 MS | 736 KB | 380 | 2022-06-09 20:20:39 |
#include<iostream> using namespace std; int main() { int a[601] = {0}; int m,n,i = 1,k = 0,temp; cin >> n; temp = n; while(n-1) { if(a[i] == 0) { k++; } if(k == 3) { a[i] = 1; k = 0; //cout << i <<" "; n--; } i++; if(i > temp) { i = 1; } } i = 1; while(a[i++]); cout << i-1<<endl; return 0; }