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

时间:2018-04-07 14:36:55   收藏:0   阅读:213

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+;//再看下一个数

                                  }

                          }

              }

原文:https://www.cnblogs.com/yangkaiming/p/8733140.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!