Exetools

Exetools (https://forum.exetools.com/index.php)
-   Source Code (https://forum.exetools.com/forumdisplay.php?f=46)
-   -   C++ to masm conversion (https://forum.exetools.com/showthread.php?t=20289)

chants 02-24-2024 01:49

Quote:

Originally Posted by Zeocrack (Post 126185)
The below C++ code can solve the problem. But need to convert it in simple masm.

#include <stdio.h>

int main(void)
{
int a,b,c,d,e,f;
int n;

for (a=2; a<=9; a++)
for (b=2; b<=9; b++)
for (c=2; c<=9; c++)
for (d=2; d<=9; d++)
for (e=2; e<=9; e++)
for (f=2; f<=9; f++)
{
n = 100000*a + 10000*b + 1000*c + 100*d + 10*e +f;
if (a*a*a*a*a*a + b*b*b*b*b*b + c*c*c*c*c*c + d*d*d*d*d*d + e*e*e*e*e*e + f*f*f*f*f*f == n)
{
printf("se! %i\n", n);
return 0;
}
}
}

your Loop ranges here on the inner loops should start from 0 not 2. Except for the very first iteration, would likely need while loops

0x1F 02-24-2024 04:09

Quote:

Originally Posted by Zeocrack (Post 130223)
The above code is not going to work.

Of course, it is not going to work, it has to be modified :)


All times are GMT +8. The time now is 15:49.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX