daily pastebin goal
65%
SHARE
TWEET

IT 1-st exc

a guest Mar 24th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Gym
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             byte n = byte.Parse(Console.ReadLine());
  14.             decimal sum = 0;
  15.             string name;
  16.  
  17.             for (; n > 0; n--)
  18.             {
  19.                 name = Console.ReadLine();
  20.  
  21.                 if (name == "treadmill")
  22.                 {
  23.                     sum += 5899;
  24.                 }
  25.                 if (name == "exercise bike")
  26.                 {
  27.                     sum += 1789;
  28.                 }
  29.                 if (name == "dumbells")
  30.                 {
  31.                     sum += 579;
  32.                 }
  33.                 if (name == "cross trainer")
  34.                 {
  35.                     sum += 1699;
  36.                 }
  37.             }
  38.             Console.WriteLine(sum);
  39.         }
  40.     }
  41. }
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