#include <iostream>
using namespace std;
struct info {
int per;
int jmp;
} player[4];
int main() {
int n;
cin >> n;
for(int i=0; i<4; ++i) {
player[i].per=0;
player[i].jmp=0;
}
for (int i=0,tem=1; i<n; ++i,++tem) {
int x = tem;
while(x) {
if(x%10==7) {
x=1;
break;
}
else x /= 10;
}//判断数字中是否有数字x
if((tem%7==0)||x) {
++player[(tem-1)%4].jmp;
--i;
} else {
player[(tem-1)%4].per = tem;
}
}
for (int i=0; i<4; ++i)
cout << player[i].jmp <<endl;
return 0;
}
来源:CSDN
作者:DeepThoughts
链接:https://blog.csdn.net/qq_41714738/article/details/104130334