0
#include <iostream>
using namespace std;
void main(int argc, char* argv[])
{
int conversion, hash;
cout << "Select one." << endl;
cout << "0: Radix Method 32" << endl;
cout << "1: Radix Method 64" << endl;
cout << "2: SumUp" << endl;
cin >> conversion;
cout << endl << "Select one." << endl;
cout << "0: Division" << endl;
cout << "1: Multiplication" << endl;
cin >> hash;
cout << "Conversion: " + conversion << endl;
cout << "hash: " + hash << endl;
}
就像這樣簡單,我越來越狂放的輸出。我覺得這很明顯,但我太累了,看不到它。我輸入變量的數字是從下一個輸出字符串中移除的字符數。例如:cin正在吃輸出流
Select one.
0: Radix Method 32
1: Radix Method 64
2: SumUp
1
Select one.
0: Division
1: Multiplication
2
onversion:
sh:
Press any key to continue . . .
Select one.
0: Radix Method 32
1: Radix Method 64
2: SumUp
5
Select one.
0: Division
1: Multiplication
1
rsion:
ash:
Press any key to continue . . .
我瘋了還是這樣做沒有意義?我是否使用cin
錯誤?我有幾個月沒有使用C++,但是我看不出有什麼問題。
'無效的主要(INT ARGC,CHAR *的argv [])'在全局範圍內是無效的在C++中。將其返回值的類型更改爲「int」。 – MikeCAT
「轉換」+轉換? – ZDF
你不是瘋了,它是有道理的。 – MikeCAT