1 条题解
-
0
C++ :
#include <cstdio> int main(){ int n; if(scanf("%d", &n) != 1) return 0; int cnt = 0; for(int i = 1; i <= n; i++){ int ok = (i % 7 == 0); for(int x = i; x > 0 && !ok; x /= 10) if(x % 10 == 7) ok = 1; if(ok){ if(cnt > 0) putchar(cnt % 10 == 0 ? '\n' : ' '); printf("%d", i); cnt++; } } if(cnt == 0) puts("NO"); else putchar('\n'); return 0; }
- 1
信息
- ID
- 2760
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者