Advertisement
TeMePyT

Untitled

May 30th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Problem_7.Inventory_Matcher
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string[] products = Console.ReadLine().Split(' ').ToArray();
  14. long[] quantity = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
  15. decimal[] price = Console.ReadLine().Split(' ').Select(decimal.Parse).ToArray();
  16. string command = Console.ReadLine();
  17. while (command != "done")
  18. {
  19. int indexOfProduct = Array.IndexOf(products, command);
  20. decimal productPrice = price[indexOfProduct];
  21. long productQuantity = quantity[indexOfProduct];
  22. Console.WriteLine($"{command} costs: {productPrice}; Available quantity: {productQuantity}");
  23. command = Console.ReadLine();
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement