#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 = 1;
while (i <= y)
{
z = z + x;
i++;
}
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+CgpjaGFyICppbnB1dF8xID0gIjExIjsgLy8gYWwgcG9zdG8gZGkgYXJndlsxXTsKY2hhciAqaW5wdXRfMiA9ICIyMSI7IC8vIGFsIHBvc3RvIGRpIGFyZ3ZbMl07CgppbnQgbW9sdGlwbGljYSAoaW50IHgsIGludCB5KQp7CiAgICBpbnQgeiA9IDA7CiAgICBpbnQgaSA9IDE7CgogICAgd2hpbGUgKGkgPD0geSkKICAgICAgewogICAgICAgIHogPSB6ICsgeDsKICAgICAgICBpKys7CiAgICAgIH0KCiAgICByZXR1cm4gejsKfQoKaW50Cm1haW4gKGludCBhcmdjLCBjaGFyICphcmd2W10pCnsKICAgIGludCB4OwogICAgaW50IHk7CiAgICBpbnQgejsKCiAgICAvLyBDb252ZXJ0ZSBsZSBzdHJpbmdoZSBvdHRlbnV0ZSBkYWxsYSByaWdhIGRpIGNvbWFuZG8KICAgIC8vIGluIG51bWVyaSBpbnRlcmkgZSBsaSBhc3NlZ25hIGFsbGUgdmFyaWFiaWxpIHggZSB5LgoKICAgIHNzY2FuZiAoaW5wdXRfMSwgIiVpIiwgJngpOwogICAgc3NjYW5mIChpbnB1dF8yLCAiJWkiLCAmeSk7CgogICAgeiA9IG1vbHRpcGxpY2EgKHgsIHkpOwoKICAgIHByaW50ZiAoIiVpICogJWkgPSAlaVxuIiwgeCwgeSwgeik7CgogICAgcmV0dXJuIDA7Cn0=