Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
117270 成书骏 06输出日期 C++ Wrong Answer 0 MS 268 KB 610 2025-04-15 22:14:36

Tests(0/2):


Code:

#include <iostream> #include <sstream> int main() { std::string inputDate; std::cout << "请输入日期(格式:日-月-年): "; std::getline(std::cin, inputDate); std::stringstream ss(inputDate); std::string day, month, year; if (std::getline(ss, day, '-') && std::getline(ss, month, '-') && std::getline(ss, year)) { std::cout << "输出日期(格式:月-日-年): " << month << "-" << day << "-" << year << std::endl; } else { std::cerr << "输入日期格式错误,请确保格式为 日-月-年" << std::endl; } return 0; }


Run Info:

------Input------
30-2016-7
------Answer-----
7-30-2016
------Your output-----
请输入日期(格式:日-月-年): 输出日期(格式:月-日-年): 2016-30-7