기발한 구구단 알고리즘 있으신분들은 개념글에 올려놓으면 어떨까요?
구구단1
for(int i=1,j=1;i<=9;(j==9)?(i++,j=1,Console::Write("\n")):(j++,Console::WriteLine("{0} x {1} = {2}",i,j,i*j)));
구구단2
void gugu2()
{
char* format = "%d x %d = %d\n";
char* format2 = "\n";
int i, j;
__asm{
mov i, 1;
mov j, 1;
FIRST_BLOCK:
cmp i, 10;
je FIRST_END_BLOCK;
mov j, 1;
SECOND_BLOCK:
cmp j,10
je SECOND_END_BLOCK;
mov eax,i;
mul j;
push eax;
push j;
push i;
push format;
call printf;
inc j;
jmp SECOND_BLOCK;
SECOND_END_BLOCK:
push format2;
call printf;
inc i;
jmp FIRST_BLOCK;
FIRST_END_BLOCK:
}
}
location.href="
http://www.mathsisfun.com/tables.html"