私は今日この簡単なプログラムを書きましたが、2つ存在しない限り動作しないことがわかりましcin.get()
た。何か案は?
#include <iostream>
using namespace std;
int main(){
int base;
while ((base < 2) || (base > 36)){
cout << "Base (2-36):" << endl;
cin >> base;
}
string base_str = "0123456789abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < base; i++){
for (int j = 0; j < base; j++){
for (int k = 0; k < base; k++){
cout << base_str[i] << base_str[j] << base_str[k] << endl;
}
}
}
cin.get();
cin.get();
}
ネストされたループの前にに移動するcin.get()
と、ループが実行されて一時停止します。1つcin.get()
取り出すと、プログラムは終了します。最新バージョンのbloodshedc++devを使用しているim