- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
int day (char* input, int begin, int number, int year)
{
switch (input[begin])
{
case 65:
if (input[begin+1] == 112)
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 91 + number;
else return 90 + number;
else if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 213 + number;
else return 212 + number;
break;
case 68:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 335 + number;
else return 334 + number;
break;
case 70:
return 31+number;
break;
case 74:
switch (input[begin+3])
{
case 117:
return number;
break;
case 101:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 152 + number; else return 151 + number;
break;
case 121:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 182 + number; else return 181 + number;
break;
}
break;
case 77:
switch (input[begin+2])
{
case 114:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 60 + number; else return 59 + number;
break;
case 121:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 121 + number; else return 120 + number;
break;
}
break;
case 78:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 305 + number; else return 304 + number;
break;
case 79:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 274 + number; else return 273 + number;
break;
case 83:
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 244 + number; else return 243 + number;
break;
}
}
besprincypniycentner 13.12.2014 11:41 # +1
Lure Of Chaos 13.12.2014 22:00 # +1
movaxbx 13.12.2014 23:24 # +1
— Чтобы никто не догадался.
sysctl 14.12.2014 10:32 # +1