text2

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace text2
{
class Program
{
static void Main(string[] args)
{
int n = Convert.ToInt16(Console.ReadLine());
int m = 0;
if(n%2==0)
{
Console.WriteLine("约数为:");
for(int i=2;i<=n/2;i++)
{
if(n%i==0)
{
Console.WriteLine(i);
}
}
}
else
{
Console.WriteLine("约数为:");
for(int i=2;i<=(n-1)/2;i++)
{
if(n%i==0)
{
Console.WriteLine(i);
}
}
}
Console.Read();
}
}
}

posted @ 2017-09-16 22:18  黄建辉  阅读(83)  评论(0)    收藏  举报