藜麦小笼包


私信TA

用户名:dotcpp0680909

访问量:857

签 名:

刁常潇

等  级
排  名 299
经  验 5603
参赛次数 0
文章发表 70
年  龄 18
在职情况 学生
学  校 山东管理学院
专  业 软件工程

  自我简介:

一名喜欢走捷径的程序猿

TA的其他文章

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int y,m,d;
    char c;
    while(cin>>y>>c>>m>>c>>d)
    {
        int sum;
        if((y%100==0&&y%400==0)||(y%100!=0&&y%4==0))
        sum=1;
        else
        sum=0;
        switch(m)
        {
            case 1:
                sum=d;
                cout<<sum<<endl;
                break;
            case 2:
                sum=31+d;
                cout<<sum<<endl;
                break;
            case 3:
                sum+=31+28+d;
                cout<<sum<<endl;
                break;
            case 4:
                sum+=31+28+31+d;
                cout<<sum<<endl;
                break;
            case 5:
                sum+=31+28+31+30+d;
                cout<<sum<<endl;
                break;
            case 6:
                sum+=31+28+31+30+31+d;
                cout<<sum<<endl;
                break;
            case 7:
                sum+=31+28+31+30+31+30+d;
                cout<<sum<<endl;
                break;
            case 8:
                sum+=31+28+31+30+31+30+31+d;
                cout<<sum<<endl;
                break;
            case 9:
                sum+=31+28+31+30+31+30+31+31+d;
                cout<<sum<<endl;
                break;
            case 10:
                sum+=31+28+31+30+31+30+31+31+30+d;
                cout<<sum<<endl;
                break;
            case 11:
                sum+=31+28+31+30+31+30+31+31+30+31+d;
                cout<<sum<<endl;
                break;
            case 12:
                sum+=31+28+31+30+31+30+31+31+30+31+30+d;
                cout<<sum<<endl;
                break;
        }
    }
    return 0;
}


 

0.0分

0 人评分

  评论区

  • «
  • »