a147. Print it all 5/16/2025

่งฃๆณ•ไธ€

โœ… ๅฎŒๆ•ดไปฃ็ขผ

่ฉ•ๅˆ†็ตๆžœ(ๅƒ่€ƒ) ๏ผš 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;
}