关于身份证查验生日的事的一些解释

这连我自己也看不清我写了什么

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
#include<iostream>
#define NOMINMAX

using namespace std;

struct Birthday
{
int y, m, d;
friend ostream& operator<<(ostream& os, Birthday& b)
{
os << b.y << "-" << b.m << "-" << b.d;
return os;
}
operator long()
{
return y * 10000 + m * 100 + d;
}
};


long getBirthdayNumberFromID(long);
Birthday getBirthdayFromBirthdayNumber(long);
Birthday getBirthdayFromID(long);


int main()
{
return 0;
}

long getBirthdayNumberFromID(long id)
{
long a = id % 1000000000000;
long b = a / 10000;
return b;
}

Birthday getBirthdayFromBirthdayNumber(long b)
{
Birthday birthday = { b / 10000,b % 10000 / 100,b % 10000 % 100 };
return birthday;
}

Birthday getBirthdayFromID(long id)
{
return getBirthdayFromBirthdayNumber(getBirthdayNumberFromID(id));
}

洛谷将会臭名昭著!!!

结果

注:kkksc03是洛谷站长

洛谷账号:jason_zhou