110,533
社区成员
发帖
与我相关
我的任务
分享
int num = 500;
int i = 0;
for (int count = 1; count <= num; count++)
{
if (count % 3 == 2 || count % 5 == 3 || count % 7 == 2)
{
Console.Write("{0}满足此条件\n", count);
if (++i == Console.WindowHeight - 2)
{
i = 0;
Console.WriteLine("按任意键继续");
Console.ReadKey(true);
}
}
}
Console.ReadLine();
int num = 500;
for(int count=1;count<=num;count++)
{
if(count % 3 ==2 || count % 5 ==3 || count % 7 ==2)
{
Console.Write("{0}满足此条件\n",count);
}
if(count%50==0)
{Console.WriteLine("按任意键继续");
Console.Read();
}
}
Console.ReadLine();
//找出1-500内,除3余2或者 除5余3或者除7余2的数
int num = 500;
for(int count=1;count<=num;count++)
{
if(count % 3 ==2 || count % 5 ==3 || count % 7 ==2)
{
Console.Write("{0}满足此条件\n",count);
}
}
Console.ReadLine();
Console.WriteLine("按任意键继续");
Console.Read();