强迫症

题源

团体程序设计天梯赛

题解

#include<iostream>
#include<string>
using namespace std;
string str;
int main(){
    cin >> str;
    if(str.size()==4){
        int a = (str[0]-'0')*10+str[1]-'0';
        if(a<22)str.insert(0,"20");
        else str.insert(0,"19");
    }
    str.insert(4,"-");
    cout << str;
    return 0;
}
posted @ 2021-05-02 16:49  summeriver13  阅读(29)  评论(0)    收藏  举报