Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
93936 叶城俊 18排列骨头 C++ Accepted 0 MS 268 KB 475 2024-10-19 15:56:20

Tests(1/1):


Code:

#include<iostream> using namespace std; int main(){ int n=30,m=9,a[31]={0},k=0,i=1; for(int i =1;i<31;i++){ a[i] = i; } while(n>15){ if(a[i] !=0 ){ k++; } if(k==9){ k=0; a[i]=0; n--; } if(i>30){ i=0; } i++; } for(int i=1;i<=30;i++){ if(a[i] !=0) cout<<a[i]<<" "; } return 0; }