al__nasim

new year and days

Apr 3rd, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4. {
  5. char s1[30], s2[7];
  6. int i, j, n, l;
  7. gets(s1);
  8. l = strlen(s1);
  9. if(l<= 9)
  10. {
  11. n = (int)(s1[0]-'0');
  12. if(n==5 || n == 6)
  13. {
  14. printf("53");
  15. return 0;
  16. }
  17. else
  18. {
  19. printf("52");
  20. return 0;
  21. }
  22. }
  23. else
  24. {
  25. if(s1[1] != ' ')
  26. {
  27. s2[0] = s1[0];
  28. s2[1] = s1[1];
  29. n = atoi(s2);
  30. if(n <= 29)
  31. {
  32. printf("12");
  33. return 0;
  34. }
  35. else if(n == 30)
  36. {
  37. printf("11");
  38. return 0;
  39. }
  40. else
  41. {
  42. printf("7");
  43. return 0;
  44. }
  45. }
  46. else{
  47. printf("12");
  48. return 0;
  49. }
  50. }
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment