- #include<iostream>
- using namespace std;
- int main()
- {
- int money1,num,money2;//money1-國家錢幣 num-多少money money2-兌換幣種
-
- cout << " <1>美元 <2>加幣 <3>歐元 <4>英鎊 <5>人民幣 <6>台幣 " <<endl;
- cout << "請輸入你手中是那種錢幣?" << endl;
- cin >> money1;
- cout << "請輸入你手中有多少幣值?" << endl;
- cin >> num;
- cout << "請輸入你想兌換那種錢幣?" << endl;
- cin >> money2;
-
- double mon[]={32.5,29.34,53.15,50.41,4.93,1};
- double Taiwan=num*mon[money1-1];
- double final=Taiwan/mon[money2-1];
-
- cout << final << endl;
-
- system("pause");
- return 0;
- }
複製代碼 |