Код: Выделить всё
#include
#include
#include
using namespace std::chrono;
int main(int arc, char* argv[]) {
const std::string password = "a";
int correct = 1;
auto start = high_resolution_clock::now();
if(password != argv[1])
correct = 0;
auto end = high_resolution_clock::now();
auto elapsed = duration_cast (end-start).count();
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/60125253/why-is-operator-for-string-comparison-linear-time-seemingly-with-respect-to[/url]
Мобильная версия