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