fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int investment_amount = 123;
  7. int profit = 4;
  8.  
  9. double return_rate = (double) profit / investment_amount * 100;
  10.  
  11. cout << "投資報酬率 (%) = " << return_rate << endl;
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
投資報酬率 (%) = 3.25203