#include <stdio.h>
char *input_1 = "11"; // al posto di argv[1];
char *input_2 = "21"; // al posto di argv[2];
int
moltiplica (int x, int y)
{
int z = 0;
int i;
for (i = 1; i <= y; i++)
{
z = z + x;
}
return z;
}
int
main (int argc, char *argv[])
{
int x;
int y;
int z;
// Converte le stringhe ottenute dalla riga di comando
// in numeri interi e li assegna alle variabili x e y.
z = moltiplica (x, y);
printf ("%i * %i = %i\n", x
, y
, z
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpjaGFyICppbnB1dF8xID0gIjExIjsgLy8gYWwgcG9zdG8gZGkgYXJndlsxXTsKY2hhciAqaW5wdXRfMiA9ICIyMSI7IC8vIGFsIHBvc3RvIGRpIGFyZ3ZbMl07CgppbnQKbW9sdGlwbGljYSAoaW50IHgsIGludCB5KQp7CiAgICBpbnQgeiA9IDA7CiAgICBpbnQgaTsKCiAgICBmb3IgKGkgPSAxOyBpIDw9IHk7IGkrKykKICAgICAgewogICAgICAgIHogPSB6ICsgeDsKICAgICAgfQoKICAgIHJldHVybiB6Owp9CgppbnQKbWFpbiAoaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkKewogICAgaW50IHg7CiAgICBpbnQgeTsKICAgIGludCB6OwoKICAgIC8vIENvbnZlcnRlIGxlIHN0cmluZ2hlIG90dGVudXRlIGRhbGxhIHJpZ2EgZGkgY29tYW5kbwogICAgLy8gaW4gbnVtZXJpIGludGVyaSBlIGxpIGFzc2VnbmEgYWxsZSB2YXJpYWJpbGkgeCBlIHkuCgogICAgc3NjYW5mIChpbnB1dF8xLCAiJWkiLCAmeCk7CiAgICBzc2NhbmYgKGlucHV0XzIsICIlaSIsICZ5KTsKCiAgICB6ID0gbW9sdGlwbGljYSAoeCwgeSk7CgogICAgcHJpbnRmICgiJWkgKiAlaSA9ICVpXG4iLCB4LCB5LCB6KTsKCiAgICByZXR1cm4gMDsKfQ==