K
Size: a a a
K
С
K
K
С
TR
TR
//***1**//
auto begin1 = std::chrono::steady_clock::now();
function();
auto end1 = std::chrono::steady_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end1-begin1);
std::cout <<"Algoritm: " << duration.count() << " mcs" << std::endl;
print(data, 0);
/***2***/
auto begin2 = std::chrono::high_resolution_clock::now();
function();
auto end2 = std::chrono::high_resolution_clock::now();
auto duration2 = std::chrono::duration_cast<std::chrono::microseconds>(end2-begin2).count();
std::cout <<"Algoritm :" << duration2 << " mcs" << std::endl;
print(data, 0);
YB
for (int i = 0, j = a.length() / 2; i < 4; i++, j++) {
b.insert(i, a[j]);
}
error: invalid conversion from ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’} to ‘const char*’ [-fpermissive]
25 | b.insert(i, a[j]);
| ^
| |
| __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
SH
for (int i = 0, j = a.length() / 2; i < 4; i++, j++) {
b.insert(i, a[j]);
}
error: invalid conversion from ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’} to ‘const char*’ [-fpermissive]
25 | b.insert(i, a[j]);
| ^
| |
| __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
Е
SH
SH
SH
K
K
for (int i = 0, j = a.length() / 2; i < 4; i++, j++) {
b.insert(i, a[j]);
}
error: invalid conversion from ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’} to ‘const char*’ [-fpermissive]
25 | b.insert(i, a[j]);
| ^
| |
| __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
a[j]
попробуй std::string(a[j])
K
K
b.insert(i, 1, a[j]);
YB
a[j]
попробуй std::string(a[j])
NM
Е