求本月有几天

来源:互联网 发布:汽车网络宣传方案 编辑:程序博客网 时间:2024/05/02 04:36

#include<iostream>

using namespace std;

int main()

{      int year,month,day;

        cout<<"输入年,月";   

          cin>>year>>month ;

      swich(maoth)

     {   cace 1:

       cace 3:

       cace 5:

       cace 7:

       cace 8:

       cace 10:

       cace 12:

day=31;break;

       cace 4:

        cace 6:

        cace 9:

        cace 11:

day=30;break;

          cace 2:

          if(year%4==0&&year%100!=0)

day=29;

else

day=28;

}

cout<<year<<"年"<<month<<"月有"<<day<<"天"<<endl;

retrun 0;

}


原创粉丝点击