fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. double n = 1.00;
  6. int q = 6;
  7.  
  8. n = n*q - ((5 * n) / 100 * q);
  9.  
  10. std::cout << "Expected: 5.7\n";
  11. std::cout << "Actual: " << n << '\n';
  12.  
  13. n = 2.50;
  14. q = 100;
  15.  
  16. n = n*q - ((10 * n) / 100 * q);
  17.  
  18. std::cout << "Expected: 225\n";
  19. std::cout << "Actual: " << n << '\n';
  20. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
Expected: 5.7
Actual: 5.7
Expected: 225
Actual: 225