

Kod:
#include
#include
#include
int
sum_of_digits (int number)
{
int temp = number;
int sum = 0;
while (temp)
{
sum += temp % 10;
temp /= 10;
}
return sum;
}
int
first_segment ()
{
int xxx = rand() % 998;
return xxx % 333 == 0 ||
xxx % 444 == 0 ||
xxx % 555 == 0 ||
xxx % 777 == 0 ? xxx + 1 : xxx;;
}
int
second_segment ()
{
int xxxxxx;
int sum;
int last;
do
{
xxxxxx = rand() % 1000000;
sum = sum_of_digits(xxxxxx);
last = 7-(sum%7);
}
while(last == 0 && last == 8);
return xxxxxx * 10 + last;
}
int
main (int argc, char *argv[])
{
srand (time (NULL));
int firstse = first_segment (), secondse = second_segment ();
printf ("[*] CD Serial Key > %03d-%07d\n", firstse, secondse);
return EXIT_SUCCESS;
}
https://paste.ubuntu.com/p/yyCJKw5crh/