#P8771. [蓝桥杯 2022 省 B] 填空问题
[蓝桥杯 2022 省 B] 填空问题
Problem Description
Task A: Base-9 to Base-10
[Problem Description]
What is the decimal value of the base-9 positive integer ?
[Answer Submission]
This is a fill-in-the-blank question. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will make you unable to get points.
Task B: Straight Dates
[Problem Description]
Xiao Ming especially likes "straights". A "straight" means three consecutive digits, such as 123, 456, etc. A "straight date" means that in the yyyymmdd representation of a date, there exists some consecutive 3-digit substring that is a straight. For example, 20220123 is a straight date because it contains a straight: 123; while 20221023 is not a straight date because it has no straight at all. Xiao Ming wants to know, in the whole year 2022, how many straight dates there are.
[Answer Submission]
This is a fill-in-the-blank question. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will make you unable to get points.
Input Format
The input contains one uppercase letter, indicating which task it is.
Output Format
According to the input task label, output the answer for the corresponding task.
Hint
Answer template for reference.
#include<iostream>
using namespace std;
int main() {
string ans [] = {
"The answer of task A", // Replace the content in double quotes with the answer for task A
"The answer of task B", // Replace the content in double quotes with the answer for task B
};
char T;
cin >> T;
cout << ans[T - 'A'] << endl;
return 0;
}
Translated by ChatGPT 5