#include "iostream"
using namespace std;
int main()
{
int num, n;
cin >> n;
int index = 0, i;
int people[4] = {0};
for (i = 1; i <= n; i++)
{
num = i;
if (num % 7 == 0)
{
people[index] += 1;
n++;
}
else
{
while (num != 0)
{
if (num % 10 == 7)
{
people[index] += 1;
n++;
break;
}
num = num / 10;
}
}
index = index == 3 ? 0 : index + 1;
}
for (int c : people)
{
cout << c << endl;
}
}
Memory逆光
发布了75 篇原创文章 · 获赞 128 · 访问量 1万+
私信
关注