现在的位置: 首页 > 综合 > 正文

求88888的最大三位约数

2012年08月26日 ⁄ 综合 ⁄ 共 571字 ⁄ 字号 评论关闭
   
 1 using System;
 2 using System.Collections.Generic;
 3 using System.Text;
 4 
 5 namespace Test
 6 {
 7     class Program
 8     {
 9         static void Main(string[] args)
10         {
11             int number;
12             Console.WriteLine("Input number:");
13             number = Convert.ToInt32(Console.ReadLine());
14             for (int i = 999; i >= 100; i--)
15             if (number % i == 0)
16             {
17                 Console.Write("The max factor with 3 digits in {0} is {1}", number, i);
18                 break;
19             }
20         }
21     }
22 }

抱歉!评论已关闭.