using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int i,count=0;
for (i = 1; i <= 100; i++) {
if (i % 3 == 0 && i % 5 != 0) {
Console.Write(i+" ");
count++;
}
}
Console.WriteLine("一共有"+count);
Console.ReadKey();
}
}
}
输出1-100中能被3整除但不能被5整除的数,并统计这样的数有多少个
最新推荐文章于 2022-11-29 13:59:23 发布