SHARE
TWEET

Untitled

a guest Mar 24th, 2019 62 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.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             //treadmill: 5899$
  13.             //cross trainer: 1699$
  14.             //bike: 1789$
  15.             //dumbbells: 579$
  16.  
  17.             int n = int.Parse(Console.ReadLine());
  18.             double sum = 0;
  19.  
  20.             for (int i = 0; i < n; i++)
  21.             {
  22.                 string A = Console.ReadLine();
  23.                 if (A == "treadmill")
  24.                 {
  25.                     sum = sum + 5899.00;
  26.                 }
  27.                 if (A == "cross trainer")
  28.                 {
  29.                     sum = sum + 1699.00;
  30.                 }
  31.                 if (A == "exercise bike")
  32.                 {
  33.                     sum = sum + 1789.00;
  34.                 }
  35.                 if (A == "dumbbells")
  36.                 {
  37.                     sum = sum + 579.00;
  38.                 }
  39.             }
  40.             Console.WriteLine(sum);
  41.  
  42.         }
  43.     }
  44. }
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