-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKC005.cpp
More file actions
44 lines (33 loc) · 1.29 KB
/
KC005.cpp
File metadata and controls
44 lines (33 loc) · 1.29 KB
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
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
string a,b,c,d,e,f,g; int w,i,ig;
//scanf("%*s %s %*s %s %*s %*s %i-%i-%i",...);
while (cin>>a>>b>>c>>d>>e>>f>>g) {
w=0; ig=1; i=1;
if(b[0]<'A' || b[0]>'Z') ig=0;
while (b[i]!=';' && ig) {
//cout<<i;
if(b[i]<'a' || b[i]>'z') ig=0;
i++;
}
if (ig) w++;
//ig=(int) b[0];
i=1;
if(d[0]<'A' || d[0]>'Z') ig=0;
while (d[i]!=';' && ig) {
//cout<<i;
if(d[i]<'a' || d[i]>'z') ig=0;
i++;
}
if (ig) {w++;
if (((g[0]=='2' && g[1]=='0' && g[2]=='0' && g[3]=='0') || (g[0]=='1' && g[1]=='9' && g[2]>='0' && g[2]<='9' && g[3]>='0' && g[3]<='9')) && ((g[5]=='0' && g[6]>='1' && g[6]<='9') || (g[5]=='1' && g[6]>='0' && g[6]<='2')) && ((g[8]=='0' && g[9]>='1' && g[9]<='9') || ((g[8]=='1' || g[8]=='2') && g[9]>='0' && g[9]<='9') || (g[8]=='3' && (g[9]=='0' || g[9]=='1')))) w++;
}
cout<<w<<endl;
cout<<b<<" "<<d<<" "<<g<<endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}