Advertisement
riff-raff

Untitled

Jun 2nd, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.51 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 geometryBySku
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int skuCounter = 0;
  14.             string sku = "";
  15.             Dictionary<string, string> dict = new Dictionary<string, string>()
  16.                                                         {
  17.                                                             {"458329","SM_N09W065_WA-1_0"},
  18.                                                             {"102030","SM_N04M045_MA-2_0"},
  19.                                                             {"203040","SM_N05M90_MA-1_0"},
  20.                                                             {"304050","SM_N06W48_WA-2_0"},
  21.                                                         };
  22.  
  23.             while (skuCounter < 20000)
  24.             {
  25.                 sku = Console.ReadLine();
  26.                 string endInput = sku;
  27.                 sku = sku.Remove(sku.Length - 4);
  28.  
  29.                 if (endInput == "end!")
  30.                 {
  31.                     break;
  32.                 }
  33.                 else if(dict.ContainsKey(sku))
  34.                 {
  35.                     Console.WriteLine($"{dict[sku]}");
  36.                 }
  37.                 else
  38.                 {
  39.                     Console.WriteLine("n/a");
  40.                 }
  41.                 skuCounter += 1;
  42.             }
  43.             Console.WriteLine($"Total assigned skus: {skuCounter}");
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement