Advertisement
Guest User

Untitled

a guest
Jul 16th, 2016
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 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. class DateAfter5Dayd
  8. {
  9. static void Main(string[] args)
  10. {
  11. int day = int.Parse(Console.ReadLine());
  12. int month = int.Parse(Console.ReadLine());
  13. day = day + 5;
  14. int daysofmonth = 31;
  15.  
  16. if (month == 4 || month == 6 || month == 9 || month == 11)
  17. {
  18. daysofmonth = 30;
  19. }
  20. else if ( month == 2)
  21. {
  22. daysofmonth = 28;
  23. }
  24. if (day > daysofmonth)
  25. {
  26. day = day - daysofmonth;
  27. month++;
  28. if (month == 13)
  29. {
  30. month = 1;
  31. }
  32. }
  33. if (month < 10)
  34. {
  35. Console.WriteLine("{0}.0{1}", day, month);
  36.  
  37. }
  38. else
  39. {
  40. Console.WriteLine("{0}.{1}", day, month);
  41.  
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement