fork download
  1. #include <iostream>
  2. #include <string>
  3. int main()
  4. {
  5. int amount;
  6. std::string currency;
  7. while ( std::cin >> amount && amount != 0 && std::cin >> currency)
  8. {
  9. std::cout << "You entered " << amount << " " << currency << "\n";
  10. }
  11. }
Success #stdin #stdout 0s 2860KB
stdin
10
USD
20
EUR
0
stdout
You entered 10 USD
You entered 20 EUR