puzzles/advent_of_code_2015/day4/main1.cc
2022-12-01 13:46:47 +01:00

24 lines
No EOL
397 B
C++

#include <iostream>
#include <string>
#include "md5.hpp"
using namespace std;
int main()
{
string prefix = "bgvyzdsv";
for (size_t idx = 0; ; ++idx)
{
string test = prefix + to_string(idx);
string hash = md5(test);
if (hash.find_first_not_of('0') == 6) //5 for solution 1
{
cout << test << "\n";
return 0;
}
}
}