D
Size: a a a
D
DP
D
МВ
МВ
AS
#include <charconv>
#include <iostream>
#include <regex>
#include <string_view>
int to_int(const std::sub_match<std::string_view::const_iterator>& sm) {
int d;
std::from_chars(sm.first, sm.second, d);
return d;
}
int main() {
std::regex r{"(\\d+)-(\\d+)-(\\d+)"};
std::string_view sv{"10-20-30"};
std::match_results<std::string_view::const_iterator> m;
if( std::regex_match(sv.begin(), sv.end(), m, r) ) {
int a = to_int(m[1]);
int b = to_int(m[2]);
int c = to_int(m[3]);
std::cout << a << '-' << b << '-' << c << std::endl;
}
}
AS
D
AS
D
ip
AS
AS
AS
DP
DP
D
SH
SH