lanqiao 2096 顺子日期
This commit is contained in:
19
13lanqiao/test2.cpp
Normal file
19
13lanqiao/test2.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user