题解 | 出生日期输入输出
出生日期输入输出
https://www.nowcoder.com/practice/4a4a9dd1edb6453ba4a0432319200743
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
string year = s.substr(0,4);
string month = s.substr(4,2);
string date = s.substr(6,2);
cout << "year=" << year << endl;
cout << "month=" << month << endl;
cout << "date=" << date <<endl;
return 0;
}
// 64 位输出请用 printf("%lld")