標題:
計算各國匯率計算成台幣的問題
[打印本頁]
作者:
stephen
時間:
2010-5-8 11:19
標題:
計算各國匯率計算成台幣的問題
題目:
計算各國錢幣計算成台幣
計算台幣換算為各國錢幣
作者:
chuangjoy
時間:
2010-5-8 11:20
本帖最後由 chuangjoy 於 2010-5-8 11:24 編輯
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void){
float m;
float t;
cout << "請輸入要兌換的錢: 1.美金 2.港幣 3.英鎊 4.澳幣 5.加拿大幣 " << endl;
cout << "6.新加坡幣 7.瑞士法郎 8.日圓 9.瑞典幣 10.紐元 11.泰幣" << endl;
cout << "12.菲國比索 13.歐元 14.馬來幣 15.人民幣" << endl;
cin >> m;
cout << "請輸入台幣" << endl;
cin >> t;
if(m = 1){
t = t / 31.43;
cout << t << endl;
}else if(m = 2){
t = t / 3.94;
cout << t << endl;
}else if(m = 3){
t = t / 46.00;
cout << t << endl;
}else if(m = 4){
t = t / 27.89;
cout << t << endl;
}else if(m = 5){
t = t / 31.10;
cout << t << endl;
}else if(m = 6){
t = t / 22.19;
cout << t << endl;
}else if(m = 7){
t = t / 28.04;
cout << t << endl;
}else if(m = 8){
t = t / 0.33;
cout << t << endl;
}else if(m = 9){
t = t / 3.71;
cout << t << endl;
}else if(m = 10){
t = t / 22.31;
cout << t << endl;
}else if(m = 11){
t = t / 0.87;
cout << t << endl;
}else if(m = 12){
t = t / 0.64;
cout << t << endl;
}else if(m = 13){
t = t / 39.93;
cout << t << endl;
}else if(m = 14){
t = t / 8.25;
cout << t << endl;
}else if(m = 15){
t = t / 4.56;
cout << t << endl;
}
system("pause");
return 0;
}
複製代碼
作者:
b1081081
時間:
2010-5-8 11:21
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void){
int money , num;
double mon[15] = {31.43,3.94,46,27.89,30.1,22.19,28.04,0.33,3.71,
22.31,0.87,0.64,39.93,8.25,4.56};
cout << "請輸入要兌換的幣種: 1.美金(USD) 2.港幣(HKD)" << endl;
cout << "3.英鎊(GBP) 4.澳幣(AUD) 5.加拿大幣(CAD) 6.新加坡幣(SGD)" << endl;
cout << "7.瑞士法郎(CHF) 8.日圓(JPY) 9.瑞典幣(SEK) 10.紐元(NZD)" << endl;
cout << "11.泰幣(THB) 12.菲國比索(PHP) 13.歐元(EUR) 14.馬來幣(MYR)" << endl;
cout << "15.人民幣(CNY)" << endl;
cin >> money;
cout << "請輸入要兌換的金額" << endl;
cin >> num;
cout << "兌換成台幣後的金額為:" << num * mon[money - 1] << endl;
system("pause");
return 0;
}
複製代碼
作者:
p17johnny
時間:
2010-5-8 11:22
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void){
int money;
int money2;
double mon[19]={31.43,3.94,46,27.89,30.10,22.19,28.04,0.33,0.00,3.71,22.31,0.87,0.64,0.00296,39.93,0.02,0.00142,8.25,4.56};
cout<<"請輸入您要選擇的幣值: 1.美金 2.港幣 3.英鎊 4.澳幣 5.加拿大幣 6.新加坡幣"<<endl;
cout<<"7.瑞士法郎 8.日圓 9.南非幣 10.瑞典幣 11.紐元 12.泰幣 13.菲國比索 "<<endl;
cout<<"14.印尼幣 15.歐元 16.韓元 17.越南盾 18.馬來幣 19.人民幣 "<<endl;
cin>>money;
cout<<"請輸入money~"<<endl;
cin>>money2;
cout<<"money="<<money2*mon[money-1]<<endl;
system("pause");
return 0;
}
複製代碼
作者:
chuangjoy
時間:
2010-5-19 21:09
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void){
int money;
int num;
double mon[15] = {31.43,3.94,46,27.89,30.1,22.19,28.04,0.33,3.71,
22.31,0.87,0.64,39.93,8.25,4.56};
cout << "請輸入要兌換的貨幣: 1.美金 2.港幣 3.英鎊 4.澳幣" << endl;
cout << "5.加拿大幣 6.新加坡幣 7.瑞士法郎 8.日圓 9.瑞典幣" << endl;
cout << "10.紐元 11.泰幣 12.菲國比索 13.歐元 14.馬來幣 15.人民幣" << endl;
cin >> money;
cout << "請輸入要轉換成台幣的貨幣" << endl;
cin >> num;
cout << "兌換成台幣後的金額為:" << num * mon[money - 1] << endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2