Generation

generate functionWed, 16 Nov 2022

create a calendar which holds the months, the day of the months can hold an integer value i have to count the number of ints per day

public static int[] DaysPerMonth = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; public static int[] Counts = new int[31]; public class Triplet { public int Month { get; private set; } public int Day { get; private set; } public int Value { get; private set; } public Triplet(int month, int day, int value) { Month = month; Day = day; Value = value; } } public static void Main(string[] args) { string line; List<Triplet> triples = new List<Triplet>(); while ((line = Console.ReadLine()) != null) { string[] parts = line.Split(' '); triples.Add(new Triplet( Int32.Parse(parts[0]), Int32.Parse(parts[1]), Int32.Parse(parts[2]))); }

Want to kickstart your project?Use the new AI Studio to create your code