我有一個整數值,例如5794欲施加幾個上的每個數計算的,而無需使用陣列如何可以使用在C int值++(簡單)
例
int encrypt;
cout << "Enter 4 digit numbers to encryption :> ";
cin >> encrypt;
for(int i=1;i<=encrypt;i++){
cout << encrypt << endl;
}
創建循環
此代碼打印整個數字,但我想打印每個數字而不使用數組。如果數字是5794,我想顯示:
5
7
9
4
我不想它顯示是這樣的:
5794
這功課嗎? – Marlon
注意:[endl vs'\ n'](http://stackoverflow.com/questions/213907/c-stdendl-vs-n) –
@Marlon:不要做作業 –