fork download
  1. #include <iostream>
  2. #include <array>
  3. using namespace std;
  4.  
  5. int main() {
  6. int item, qtde;
  7. cin >> item >> qtde;
  8. array<float, 5> valores = { 4.00, 4.50, 5.00, 2.00, 1.50 };
  9. cout << "Total: R$" << valores[item - 1] * qtde;
  10. }
  11.  
  12. //https://pt.stackoverflow.com/q/322871/101
Success #stdin #stdout 0s 4508KB
stdin
3 2
stdout
Total: R$10