using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int count = 0;
int k;
for (int i = 1000; i < 9999; i++)
{
k = i * 10 + 6;
if (k % 3== 0)
{
Console.WriteLine(k);
count++;
}
}
Console.WriteLine(count);
}
}
}
C#趣味程序---个位数为6,且能被3整出的五位数
关注
打赏