我怎样才能使我的代码跳过for循环中的一行

时间:2019-10-10 21:52:28

标签: c++ clion

我正试图跳过第13行,但我不知道该怎么做

#include <iostream>

int main()
{
    using namespace std;
    int i, j;
    cout << "Type in the elevator where you want to proceed: "  << endl;
    cin >> j;
    for(i=1;  i<= j; i++) {
    if ( i==13)continue;
    cout << "Your elevator number is at: " << i << endl;
    }

    return 0;
}

0 个答案:

没有答案