Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Problem_7.Inventory_Matcher
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] products = Console.ReadLine().Split(' ').ToArray();
- long[] quantity = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
- decimal[] price = Console.ReadLine().Split(' ').Select(decimal.Parse).ToArray();
- string command = Console.ReadLine();
- while (command != "done")
- {
- int indexOfProduct = Array.IndexOf(products, command);
- decimal productPrice = price[indexOfProduct];
- long productQuantity = quantity[indexOfProduct];
- Console.WriteLine($"{command} costs: {productPrice}; Available quantity: {productQuantity}");
- command = Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement