Code:
#include <stdio.h>
void stupidone (unsigned short c, char *buf)
{
char name[56];
char frmths[200];
strncpy (frmths,buf,c);
snprintf (frmths,56,name);
printf ("%s",frmths);
}
main (int argc, char **argv)
{
char buffer[256];
int a, b, c;
char buf[16];
system ("/usr/bin/clear");
printf ("########################\n");
printf ("# W4rCr0-21 - LEVEL XX #\n");
printf ("########################\n");
printf ("- I'm quiet.\n\n");
printf ("> This program can compute 31337^999999999999999999999999 in 1/1000000000 nano sec. :-)\n");
printf ("\n> Project name: ");
fgets (buffer,sizeof(buffer),stdin);
printf ("\n> Give me first number: ");
fgets (buf,sizeof(buf),stdin);
a = atoi (buf);
if (a < 0)
{
printf ("\n> ERROR: First number is negative!!!!\n");
exit(0);
}
a += 16;
printf ("\n> Give me second number: ");
fgets (buf,sizeof(buf),stdin);
b = atoi (buf);
if (b < 0)
{
printf ("\n> ERROR: Second number is negative!!!\n");
exit(0);
}
b += 16;
c = a * b;
if (c >= 256 || c <= 0)
{
printf ("\n> ERROR: %d * %d = %d - this is too easy for me!!!\n",a,b,c);
exit (0);
}
else printf ("\n> %d * %d = %d \n", a, b, c);
printf ("\n");
stupidone(c,buffer);
}
#include <stdio.h>
void stupidone (unsigned short c, char *buf)
{
char name[56];
char frmths[200];
strncpy (frmths,buf,c);
snprintf (frmths,56,name);
printf ("%s",frmths);
}
main (int argc, char **argv)
{
char buffer[256];
int a, b, c;
char buf[16];
system ("/usr/bin/clear");
printf ("########################\n");
printf ("# W4rCr0-21 - LEVEL XX #\n");
printf ("########################\n");
printf ("- I'm quiet.\n\n");
printf ("> This program can compute 31337^999999999999999999999999 in 1/1000000000 nano sec. :-)\n");
printf ("\n> Project name: ");
fgets (buffer,sizeof(buffer),stdin);
printf ("\n> Give me first number: ");
fgets (buf,sizeof(buf),stdin);
a = atoi (buf);
if (a < 0)
{
printf ("\n> ERROR: First number is negative!!!!\n");
exit(0);
}
a += 16;
printf ("\n> Give me second number: ");
fgets (buf,sizeof(buf),stdin);
b = atoi (buf);
if (b < 0)
{
printf ("\n> ERROR: Second number is negative!!!\n");
exit(0);
}
b += 16;
c = a * b;
if (c >= 256 || c <= 0)
{
printf ("\n> ERROR: %d * %d = %d - this is too easy for me!!!\n",a,b,c);
exit (0);
}
else printf ("\n> %d * %d = %d \n", a, b, c);
printf ("\n");
stupidone(c,buffer);
}
Leon Juranic