码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2018-04-07 15:00:42      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:mes   number   line   nbsp   names   div   cat   while   ring   

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

                                  }

                          }

              }

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

标签:mes   number   line   nbsp   names   div   cat   while   ring   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!