用c#语言编写1000以内能整除3的数字

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

namespace ConsoleApplicationl

{

         class Program

          {   

                  static void Main(string[] args)

                   {

                           int number = 1; //当前的数字

                           while (number <= 1000)

                           {

                                      //判断当前的数字能否被3整除

                                      if (number % 3 == 0)

                                      {

                                              Console.WriteLine(number);

                                       }

                                        number+;//再看下一个数

                                  }

                          }

              }

posted @ 2018-04-07 14:00  YKmaster  阅读(1061)  评论(13编辑  收藏  举报