C#学习(2)

C#逻辑语句if   else运用

    有三种类型:

           【1】if(....)//判断条件

                     {

                            程序代码,运算等

                       }

                   if(....)//判断条件

                     {

                            程序代码,运算等

                       }

                      ...........

                       多个if连续运用

            【2】if(....)//判断条件

                     {

                            程序代码,运算等

                       }

                   else(....)//判断条件

                     {

                            程序代码,运算等

                       }

             【3】if(....)//判断条件

                     {

                            程序代码,运算等

                       }

                   else if(....)//判断条件

                     {

                            程序代码,运算等

                       }

                    if(....)//判断条件

                     {

                            程序代码,运算等

                       }

 下面是if  else运用判断年份是平年还是闰年

 

                 

    

posted @ 2016-03-31 20:52  jakermk  阅读(156)  评论(0编辑  收藏  举报