标题:求解...if else 嵌套的问题!!
取消只看楼主
等你的解答
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2012-3-19
结帖率:83.33%
已结贴  问题点数:10 回复次数:1 
求解...if else 嵌套的问题!!
#include<stdio.h>

int main(void)
{
         int years, m, day;
         scanf("%d %d\n", &years, &m);
         if(years%400 == 0 || (years%4 == 0 && years%400 !=0));
         {
                if(m == 2)    {
                               printf("day=29");
                              }
                else {
                              if(m ==4 || m == 6 || m==9 ||m==11);
                              {
                               printf("day=30");
                              }  
                else          {
                              printf("day=31");
                              }
                     }
         }
         else
         {
                if(m == 2)    {
                               printf("day=28");
                              }
                else {
                              if(m ==4||m==6||m==9||m ==11);
                              {                  
                               printf("day=30");
                              }  
                else          {
                              printf("day=31");
                              }
                     }

         }
         return 0;
}


报错说的是else 前面没有if;求各位大侠帮帮忙,题目是:
输入年份和月份判断这个月份的天数。
搜索更多相关主题的帖子: void include 
2012-03-19 22:39
等你的解答
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2012-3-19
得分:0 
多谢各位大侠!!!感激涕零!!!
2012-03-20 19:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-363699-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.167799 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved