#include <stdio.h>
char *input_1 = "11"; // al posto di argv[1];
char *input_2 = "3"; // al posto di argv[2];
int
dividi (int x, int y)
{
int z = 0;
int i = x;
while (i >= y)
{
i = i - y;
z++;
}
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 = dividi (x, y);
printf ("Divisione intera - %i:%i = %i\n", x
, y
, z
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpjaGFyICppbnB1dF8xID0gIjExIjsgLy8gYWwgcG9zdG8gZGkgYXJndlsxXTsKY2hhciAqaW5wdXRfMiA9ICIzIjsgIC8vIGFsIHBvc3RvIGRpIGFyZ3ZbMl07CgppbnQKZGl2aWRpIChpbnQgeCwgaW50IHkpCnsKICAgIGludCB6ID0gMDsKICAgIGludCBpID0geDsKCiAgICB3aGlsZSAoaSA+PSB5KQogICAgICB7CiAgICAgICAgaSA9IGkgLSB5OwogICAgICAgIHorKzsKICAgICAgfQoKICAgIHJldHVybiB6Owp9CgppbnQKbWFpbiAoaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkKewogICAgaW50IHg7CiAgICBpbnQgeTsKICAgIGludCB6OwoKICAgIC8vIENvbnZlcnRlIGxlIHN0cmluZ2hlIG90dGVudXRlIGRhbGxhIHJpZ2EgZGkgY29tYW5kbwogICAgLy8gaW4gbnVtZXJpIGludGVyaSBlIGxpIGFzc2VnbmEgYWxsZSB2YXJpYWJpbGkgeCBlIHkuCgogICAgc3NjYW5mIChpbnB1dF8xLCAiJWkiLCAmeCk7CiAgICBzc2NhbmYgKGlucHV0XzIsICIlaSIsICZ5KTsKCiAgICB6ID0gZGl2aWRpICh4LCB5KTsKCiAgICBwcmludGYgKCJEaXZpc2lvbmUgaW50ZXJhIC0gJWk6JWkgPSAlaVxuIiwgeCwgeSwgeik7CgogICAgcmV0dXJuIDA7Cn0=