-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest6.c
68 lines (62 loc) · 1.26 KB
/
test6.c
1
2
3
4
5
6
7
8
9
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
65
66
67
68
#include <stdio.h>
#include <string.h>
int main()
{
int n1;
int n2;
char NIC[] = "77131324V";
int intNIC[20];
int current;
for (int i1 = 0; i1 < strlen(NIC) - 1; i1++)
{
current = NIC[i1];
current = current - 48;
intNIC[i1] = current;
// printf("%d",current);
}
int result;
current = NIC[n1];
for (int i = n1; i < n2; i++)
{
current = current * 10;
current = current + NIC[i];
}
result = current;
printf("%d", result);
return 0;
}
int monthdate(int day, int year)
{
int result, value, count = 1, month, days, pass = 11;
value = value + monthd(year, count);
for (int i = 0; i < pass; i++)
{
if (value < day)
{
if ((value + monthd(year, count + 1)) > day)
{
pass = 1;
}
else
{
count++;
value = value + monthd(year, count);
}
}
}
days = day - value;
if (days == 0)
{
days = 1;
count = count + 1;
}
else
{
count = count + 1;
}
// printf("%d",value);
// printf("%d", count);
// printf("%d", days);
result = (count * 100) + days;
return result;
}