viraco4a

Untitled

Jan 20th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 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 Radoslava
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string InputLine = Console.ReadLine();
  14. List<Svaliach> AllSvaliachiNaRadoslava = new List<Svaliach>();
  15. while (InputLine != "end")
  16. {
  17. Svaliach NewSvaliach = GetNewSvaliach(InputLine);
  18. AddNewSvaliachIfHeMeetsTheCriteria(AllSvaliachiNaRadoslava, NewSvaliach);
  19.  
  20.  
  21.  
  22. InputLine = Console.ReadLine();
  23. }
  24. }
  25.  
  26. private static void AddNewSvaliachIfHeMeetsTheCriteria(List<Svaliach> AllSvaliachiNaRadoslava, Svaliach NewSvaliach)
  27. {
  28. if (NewSvaliach.PrivateLifeStatuss == "single" || NewSvaliach.PrivateLifeStatuss == "divorced")
  29. {
  30. if (NewSvaliach.IQ >= 90 || !NewSvaliach.IsSmoker || NewSvaliach.LevelOfSexinessFrom1To10 >= 7 || NewSvaliach.Coolnessfrom1To10 >= 7)
  31. {
  32. AllSvaliachiNaRadoslava.Add(NewSvaliach);
  33. }
  34. }
  35. }
  36.  
  37. private static Svaliach GetNewSvaliach(string InputLine)
  38. {
  39. string[] splittedInput = InputLine.Split(' ').ToArray();
  40. Svaliach NewSvaliach = new Svaliach();
  41. NewSvaliach.Name = splittedInput[0];
  42. NewSvaliach.LevelOfSexinessFrom1To10 = int.Parse(splittedInput[1]);
  43. NewSvaliach.Coolnessfrom1To10 = int.Parse(splittedInput[2]);
  44. NewSvaliach.IQ = double.Parse(splittedInput[3]);
  45. if (splittedInput[4] == "yes")
  46. {
  47. NewSvaliach.IsSmoker = true;
  48. }
  49. else
  50. {
  51. NewSvaliach.IsSmoker = false;
  52. }
  53.  
  54. NewSvaliach.PrivateLifeStatuss = splittedInput[5];
  55. return NewSvaliach;
  56. }
  57. }
  58.  
  59. public class Svaliach
  60. {
  61. public string Name { get; set; }
  62. public int LevelOfSexinessFrom1To10 { get; set; }
  63. public int Coolnessfrom1To10 { get; set; }
  64. public double IQ { get; set; }
  65. public bool IsSmoker { get; set; }
  66. public string PrivateLifeStatuss { get; set; }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment