|
1. Старший класс школы.
10 PRINT "HELLO WORLD"
20 END
2. Младший курс института.
program Hello(input,output)
begin
writeln('Hello World')
end.
3. Старший курс института.
#include
void main(void)
{
char *message[] = {"Hello ","World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}
4. Опытный профессионал.
#include
class string
{ private:
int size;
char *ptr;
public:
string() : size(0), ptr(new char('\0')) {}
string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}
~string()
{
delete [] ptr;
}
friend ostream &operator << (ostream &, const string &);
string &operator = (const char *);
};
ostream &operator << (ostream &stream, const tring &s)
{
return(stream << s.ptr);
}
string &string::operator = (const char *chrs)
{
if(this != &chr)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chr);
}
return(*this);
}
int main()
{
string str;
str = "Hello World";
cout << str << endl;
return(0);
}
5. Системный администратор.
#include
main()
{ char *tmp;
int i=0;
/*Хапнем побольше*/
tmp = (char *)malloc(1024*sizeof(char));
while (tmp[i]="Hello World"[i++]);
/*Блин, лажанулся*/
i = (int)tmp[8];
tmp[8] = tmp[9];
tmp[9] = (char)i;
printf("%s\n",tmp);
}
6. Hачинающий хакер.
#!/usr/local/bin/perl
$msg="Hello, World.\n";
if ($#ARGV >= 0)
{
while(defined($arg=shift(@ARGV)))
{
$outfilename = $arg;
open(FILE, ">" . $outfile name) || die "Can't close $arg:$!\n";
}
} else {
print($msg);
}
1;
7. Понаторевший хакер.
#include
#define S "Hello, World\n"
main()
{exit(printf(S)==strlen(S)?0:1);}
8. Закаленный ххакер.
% cc -o a.out
~/src/misc/hw/hw.c
% a.out
9. Хакер-гуру.
% cat
Hello, World.
^D
10. Младший менеджер.
10 PRINT "HELLO WORLD"
20 END
11. Менеджер среднего уровня.
% mail -s "Hello, World."
bob@b12
Боб, не могли бы Вы написать для меня программу "Hello, World"?
Она понадобится мне завтра.
^D
12. Старший менеджер.
% zmail jim
Мне нужна программа "Hello, World", и немедленно!
13. Президент компании.
% letter
letter: Command not found.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% Задница!
!: Event unrecognized.
% logout
|