SHARE
TWEET

Untitled

a guest Oct 21st, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Names
  5. {
  6.     internal static class HistogramTask
  7.     {
  8.         public static HistogramData GetBirthsPerDayHistogram(NameData[] names, string name)
  9.         {
  10.             var days = Enumerable.Range(1, 31).Select(x => Convert.ToString(x)).ToArray();
  11.             var _names = names.Where(_name => _name.Name == name).Select(_name => _name.BirthDate.Day).Select(Convert.ToDouble).ToArray();
  12.             _names[0] = 0;
  13.  
  14.             return new HistogramData(
  15.                 string.Format("Рождаемость людей с именем '{0}'", name),
  16.                 days, _names);
  17.         }
  18.     }
  19. }
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