Advertisement
Ronka

Untitled

Jun 12th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 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 Arrays_MoreEx
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string[] name = Console.ReadLine().Split();
  14. decimal[] quantity = Console.ReadLine().Split().Select(decimal.Parse).ToArray();
  15. decimal[] price = Console.ReadLine().Split().Select(decimal.Parse).ToArray();
  16.  
  17. while(true)
  18. {
  19. string input = Console.ReadLine();
  20.  
  21. if (input == "done")
  22. {
  23. break;
  24. }
  25.  
  26. int index = Array.IndexOf(name, input);
  27. Console.WriteLine($"{name[index]} costs: {price[index]}; Available quantity: {quantity[index]}");
  28.  
  29. }
  30.  
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement