AcWing 3458. 强迫症
原题链接
简单
作者:
帅小柏
,
2021-04-30 21:14:16
,
所有人可见
,
阅读 615
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
string s;
void check(){
int n =s.size();
if(n>4){
for (int i = 0; i < n; i ++ ){
cout << s[i];
if(i==3)cout<<"-";
}
}
else{
int x=10*(s[0]-'0')+s[1]-'0';
if(x<22) {
cout << "20";
for (int i = 0; i < n; i ++ ){
cout << s[i];
if(i==1)cout<<"-";
}
}
else{
cout << "19";
for (int i = 0; i < n; i ++ ){
cout << s[i];
if(i==1)cout<<"-";
}
}
}
}
int main()
{
cin>>s;
check();
return 0;
}