首先,你需要在程序中包含头文件 #include <iostream>
和 #include <regex>
。
然后,你可以使用 std::cin
和 std::cout
输入和输出数据。
你可以使用 std::regex_match
和 std::cmatch
来匹配正则表达式。
例如:
#include <iostream>
#include <regex>
int main() {
int n;
std::cin >> n;
std::string s;
std::cmatch m;
for (int i = 0; i < n