#P8790. [蓝桥杯 2022 国 C] 填空问题
[蓝桥杯 2022 国 C] 填空问题
Problem Description
Problem A: Fibonacci and 7
Problem Description
The recurrence formula of the Fibonacci sequence is: , where .
Among terms to (inclusive) of the Fibonacci sequence, how many terms have a ones digit of ?
Answer Submission
This is a fill-in-the-blank (final answer only) problem. You only need to compute the result and submit it. The result of this problem is a string consisting of digits. When submitting the answer, only fill in this string; any extra content will cause you to receive no score.
Problem B: Xiaolan Does Experiments
Problem Description
Xiaolan really likes scientific research. Recently, he did an experiment and obtained a batch of experimental testdata: a total of two million positive integers. If everything goes as expected, all experimental data should satisfy . However, experiments always have some errors, which may cause some unexpected data to appear. Such error data is in the range . Since Xiaolan is very reliable in doing experiments, more than of all his experimental testdata meets the expectation. All of Xiaolan’s experimental testdata is in primes.txt. Now he wants to count how many of these two million positive integers are prime numbers. Can you tell him?
Answer Submission
This is a fill-in-the-blank (final answer only) problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting the answer, only fill in this integer; any extra content will cause you to receive no score.
Input Format
You can submit by uploading an answer file. You need to put your answers into 1.out and 2.out, where 1.out corresponds to the answer for Problem A, and 2.out corresponds to the answer for Problem B.
The input file contains one character, representing the problem ID (A or B). You need to output the corresponding answer.
The following template is for reference:
#include<bits/stdc++.h>
using namespace std;
char pid;
int main() {
cin >> pid;
if(pid == 'A')
puts("Answer for Problem A");
else
puts("Answer for Problem B");
return 0;
}
Output Format
Based on the input problem ID, output the corresponding answer for that problem.
Hint
Translated by ChatGPT 5