Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Verifica
- {
- class Program
- {
- static void Main(string[] args)
- {
- int sundaysFirstOfMonth = 0;
- for (int year = 1901; year <= 2000; ++year)
- {
- for (int month = 1; month <= 12; ++month)
- {
- if ((new DateTime(year, month, 1)).DayOfWeek == DayOfWeek.Sunday)
- {
- ++sundaysFirstOfMonth;
- }
- }
- }
- Console.WriteLine("Ocurrieron {0} domingos que fueron primer día del mes", sundaysFirstOfMonth);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement