Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
DaysOfYear
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { foreach(string day in GetDaysOfYear(2020)){ Console.WriteLine(day); } } public static IEnumerable<string> GetDaysOfYear(int year) { string[] months = new string[]{ "января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"}; int[] duration = new int[]{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; if(year % 4 == 0){ duration[1] = 29; } for(int m = 0; m < monthes.Length; m++) { for(int d = 1; d <= duration[m]; d++) { yield return $"{d} {monthes[m]}"; } } } } }
run
|
edit
|
history
|
help
0
Jerold
codeWall
W.I.P (c#)
Evo Ivana da budes fancy :D
ss
asxsadaxsdf
Download a .NET assembly, and execute a static, parameterless method.
Fibonacci Series
C# program to Determine if Two Words Are Anagrams of Each Other
Octavia