2021CCCC天梯赛L1-075

#include<iostream>
using namespace std;

int main()
{
    string s;
    cin>>s;
    if(s.size()==4)
    {
        int a=stoi(s.substr(0,2));
        int b=stoi(s.substr(2,2));
        if(a<=21)printf("20%02d-%02d",a,b);
        else printf("19%02d-%02d",a,b);
    }
    else
    {
        int a=stoi(s.substr(0,4));
        int b=stoi(s.substr(4,2));
        printf("%04d-%02d",a,b);
    }
    return 0;
}
上一篇:单向链表之两数相加


下一篇:2021CCCC天梯赛L1-076