Advertisement
kema

PerfectGirlfriend

Apr 21st, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.40 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.     class PerfectGirlfriend
  7.     {
  8.         static void Main()
  9.         {
  10.             string inputData = Console.ReadLine();
  11.             int counter = 0;
  12.  
  13.             while (inputData!="Enough dates!")
  14.             {
  15.                 int day = 0;
  16.                 var inputParams = inputData.Split('\\');
  17.                 var braCM = int.Parse(inputParams[2].Substring(0, inputParams[2].Length-1));
  18.                 int sizeBra = inputParams[2][inputParams[2].Length-1];
  19.                 int rezult = braCM * sizeBra;
  20.                 char fistLetter = inputParams[3][0];
  21.                 int sumTel = 0;
  22.                 int calculations = 0;
  23.                
  24.                 switch (inputParams[0])
  25.                 {
  26.                     case "Monday":
  27.                         day += 1;
  28.                         break;
  29.                     case "Tuesday":
  30.                         day += 2;
  31.                         break;
  32.                     case "Wednesday":
  33.                         day += 3;
  34.                         break;
  35.                     case "Thursday":
  36.                         day += 4;
  37.                         break;
  38.                     case "Friday":
  39.                         day += 5;
  40.                         break;
  41.                     case "Saturday":
  42.                         day += 6;
  43.                         break;
  44.                     case "Sunday":
  45.                         day += 7;
  46.                         break;
  47.                     default:
  48.                         break;
  49.                 }
  50.  
  51.                 for (int i = 0; i < inputParams[1].Length; i++)
  52.                 {
  53.                     sumTel += (inputParams[1][i] - '0');
  54.                 }
  55.                 int sumName = fistLetter * inputParams[3].Length;
  56.  
  57.                 calculations = (day + sumTel + rezult) - sumName;
  58.                 if (calculations>=6000)
  59.                 {
  60.                     counter++;
  61.                     Console.WriteLine("{0} is perfect for you.", inputParams[3]);
  62.                 }
  63.                 else
  64.                 {
  65.                     Console.WriteLine("Keep searching, {0} is not for you.", inputParams[3]);
  66.  
  67.                 }
  68.                    
  69.                     inputData = Console.ReadLine();
  70.             }
  71.             Console.WriteLine(counter);
  72.  
  73.         }
  74.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement