C#输出40以内的所有奇数程序代码

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

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int s = 0, num = 80;
            while (s < num)
            {
                s++;
                    if(s>40)
                    {
                        break;
                    }
                if((s%2)==0)
                {
                    continue;
                }
                Console.WriteLine( s );
            }
            Console.ReadLine();
        }         
    }
}

  

posted on 2016-08-09 14:00  春暖花开28  阅读(464)  评论(0)    收藏  举报

导航