敲7
Time Limit:1000MS Memory Limit:65536K
Total Submit:444 Accepted:219
Description
description:
输出7和7的倍数,还有包含7的数字例如(17,27,37...70,71,72,73...)
Input
input
一个整数N。(N不大于3000)
Output
output
从小到大排列的不大于N的与7有关的数字,每行一个。
Sample Input
20Sample Output
71417Source
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AK1136 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); for (int i = 1; i <= n; i++) { if (i % 7 == 0 || i % 10 == 7 || i / 10 % 10 == 7 || i / 100 % 10 == 7) Console.WriteLine(i); } } } }