SHARE
TWEET

1va

a guest Mar 24th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static void Main(string[] args)
  2.         {
  3.             Dictionary<string, int> uredi = new Dictionary<string, int>();
  4.             uredi.Add("treadmill", 5899);
  5.             uredi.Add("cross trainer", 1699);
  6.             uredi.Add("dumbbells", 579);
  7.             uredi.Add("exercise bike", 1789);
  8.  
  9.             int n = int.Parse(Console.ReadLine());
  10.             int sum = 0;
  11.  
  12.             string input = "";
  13.             for (int i = 0; i < n; i++)
  14.             {
  15.                 input = Console.ReadLine();
  16.                 if (uredi.ContainsKey(input))
  17.                 {
  18.                     sum += uredi[input];
  19.                 }
  20.             }
  21.             Console.WriteLine($"sum:f2");
  22.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top