解法一
✅ 完整代碼
評分結果(參考) : AC (3ms, 336KB)
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
while(true){
cin >> n;
if(n == 0) break;
for(int i=1; i<n; i++){
if(i%7 != 0){
if(i != 1) cout << " ";
cout << i;
}
}
cout << "\n";
}
return 0;
}