#include <stdio.h>
char *input_1 = "1111"; // al posto di argv[1];
int
radice (int x)
{
int z = 0;
int t = 0;
while (1)
{
t = z * z;
if (t > x)
{
// È stato superato il valore massimo.
z--;
return z;
}
z++;
}
// Teoricamente, non dovrebbe mai arrivare qui.
}
int
main (int argc, char *argv[])
{
int x;
int z;
z = radice (x);
printf ("radq(%i) = %i\n", x
, z
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpjaGFyICppbnB1dF8xID0gIjExMTEiOyAvLyBhbCBwb3N0byBkaSBhcmd2WzFdOwoKaW50CnJhZGljZSAoaW50IHgpCnsKICAgIGludCB6ID0gMDsKICAgIGludCB0ID0gMDsKCiAgICB3aGlsZSAoMSkKICAgICAgewogICAgICAgIHQgPSB6ICogejsKCiAgICAgICAgaWYgKHQgPiB4KQogICAgICAgICAgewogICAgICAgICAgICAvLyAgw4ggc3RhdG8gc3VwZXJhdG8gaWwgdmFsb3JlIG1hc3NpbW8uCiAgICAgICAgICAgIHotLTsKICAgICAgICAgICAgcmV0dXJuIHo7CiAgICAgICAgICB9CgogICAgICAgIHorKzsKICAgICAgfQoKICAgIC8vIFRlb3JpY2FtZW50ZSwgbm9uIGRvdnJlYmJlIG1haSBhcnJpdmFyZSBxdWkuCn0KCmludAptYWluIChpbnQgYXJnYywgY2hhciAqYXJndltdKQp7CiAgICBpbnQgeDsKICAgIGludCB6OwoKICAgIHNzY2FuZiAoaW5wdXRfMSwgIiVpIiwgJngpOwoKICAgIHogPSByYWRpY2UgKHgpOwoKICAgIHByaW50ZiAoInJhZHEoJWkpID0gJWlcbiIsIHgsIHopOwoKICAgIHJldHVybiAwOwp9