19 lines
525 B
C++
19 lines
525 B
C++
// lanqiao 2096 顺子日期
|
|
#include<bits/stdc++.h>
|
|
using namespace std;
|
|
int main(){
|
|
string t1 = "012", t2 = "123";
|
|
int ans = 0;
|
|
for(int i = 1; i <= 12; i++){
|
|
for(int j = 1; j <= 31; j++){
|
|
string t = "2022";
|
|
if(i < 10) t += '0' + to_string(i);
|
|
else t += to_string(i);
|
|
if(j < 10) t += '0' + to_string(j);
|
|
else t += to_string(j);
|
|
if(t.find(t1) != -1 || t.find(t2) != -1) ans++;
|
|
}
|
|
}
|
|
cout << ans << endl;
|
|
return 0;
|
|
} |