Advertisement
Guest User

uhhhh months

a guest
Feb 9th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 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 ConsoleApplication1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. string[] days = new string[] { "Mon", "Tue", "Wed", "Thu", "Fri" };
  15. string[] months = new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
  16.  
  17. int tmp = 0, numDays = 1;
  18. bool next = false;
  19. do
  20. {
  21. next = false;
  22. while (!next)
  23. {
  24. for (int i = 0; i < days.Length; i++)
  25. {
  26.  
  27. if ((months[tmp] == "Feb" && numDays == 29) || (months[tmp] == "Apr" && numDays == 31) ||
  28. (months[tmp] == "Jun" && numDays == 31) || (months[tmp] == "Sep" && numDays == 31) ||
  29. (months[tmp] == "Nov" && numDays == 31))
  30. {
  31. numDays = 1;
  32. next = true;
  33. break;
  34. }
  35. Console.WriteLine(months[tmp] + numDays + days[i]);
  36. numDays++;
  37.  
  38. if (numDays > 31)
  39. {
  40. numDays = 1;
  41. next = true;
  42. break;
  43. }
  44. }
  45. }
  46.  
  47.  
  48. tmp++; //Månaderna
  49. } while (tmp < 12);
  50.  
  51. Console.ReadKey();
  52.  
  53. }
  54.  
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement