#include<iostream>
using namespace std;
bool judge(int n) {
if (n % 7 == 0)
return true;
else {
while (n) {
if (n % 10 == 7)
return true;
n /= 10;
}
}
return false;
}
int main() {
int A = 0, B = 0, C = 0, D = 0;
int n;
cin >> n;
int i = 1;
for (int j = 1; i <= n; j++) {
if (judge(j)) {
if (j % 4 == 0)D++;
else if (j % 4 == 1)A++;
else if (j % 4 == 2)B++;
else C++;
}
else
i++;
}
printf("%d\n%d\n%d\n%d\n", A, B, C, D);
}
csp考试20191201报数
最新推荐文章于 2023-11-22 16:35:06 发布