本题链接:201912-1 报数
本博客给出本题截图:
C++
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int ans[4];
int main()
{
int n;
cin >> n;
int k = 0, i = -1;
while (n)
{
i ++ ;
k ++ ;
if (k % 7 == 0 || to_string(k).find('7') != -1) ans[i % 4] ++ ;
else n -- ;
}
for (int i = 0; i < 4; i ++ ) cout << ans[i] << endl;
return 0;
}
总结
水题,不解释