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 Arrays_MoreEx
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] name = Console.ReadLine().Split();
- decimal[] quantity = Console.ReadLine().Split().Select(decimal.Parse).ToArray();
- decimal[] price = Console.ReadLine().Split().Select(decimal.Parse).ToArray();
- while(true)
- {
- string input = Console.ReadLine();
- if (input == "done")
- {
- break;
- }
- int index = Array.IndexOf(name, input);
- Console.WriteLine($"{name[index]} costs: {price[index]}; Available quantity: {quantity[index]}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement