fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. float USD;
  9. float NTD;
  10. float EX=33.23f;
  11. int n;
  12.  
  13. cout << "目前匯率 1USD=33.23*NTD" << endl;
  14. cout << "請輸入你要換算的美元數:";
  15. cin >> n;
  16. cout << "這是你輸入的美元數:" << n << endl;
  17.  
  18. USD=n*NTD*EX;
  19.  
  20. cout << "這是換算出來的台幣數:" << float(USD) << endl;
  21.  
  22.  
  23. system("pause");
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
目前匯率 1USD=33.23*NTD
請輸入你要換算的美元數:這是你輸入的美元數:134515305
這是換算出來的台幣數:0