#31040: continue真好用


jason096727@gmail.com (Jason Ho)

學校 : 高雄市苓雅區福東國民小學
編號 : 189939
來源 : [150.116.71.76]
最後登入時間 :
2023-07-15 21:32:51
a147. Print it all | From: [150.116.71.227] | 發表日期 : 2022-07-06 19:29


#include <iostream>

using namespace std;

int main()
{
    int n;
    while (cin >> n){
        if (n==0){
            break;
        }
        else {
            for (int i=1; i<n; i++){
                if (i%7==0){
                    continue;
                }
                cout << i << " ";
            }
            cout << '\n';
        }
    }

    return 0;
}

 
ZeroJudge Forum