lanqiao 2096 顺子日期

This commit is contained in:
2025-03-29 17:01:39 +08:00
parent 3e0f8bbb67
commit c0e8fee1ac

19
13lanqiao/test2.cpp Normal file
View File

@@ -0,0 +1,19 @@
// 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;
}