[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-team] Humour :"Hello World"
Enoncé : Le but de la manipulation est d'écrire un programme qui
affichera "HELLO WORLD" à l'écran.
1) Rhéto :
10 PRINT "HELLO WORLD"
20 END
2) 1ère candi info :
program HELLO(input, output)
begin
writeln('HELLO WORLD')
end.
3) 1ère licence info :
(defun HELLO
(print
(cons 'HELLO (list 'WORLD))
)
)
4) Fraïchement sorti de l'unif :
#include <stdio.h>
void main(void)
{
char *message[] = {"HELLO ", "WORLD"}; int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}
5) Professionnel très expérimenté
#include <iostream.h>
#include <string.h>
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 string &s) {
return(stream << s.ptr);
}
string &string::operator=(const char *chrs) {
if (this != &chrs)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
}
return(*this);
}
int main()
{
string str;
str = "HELLO WORLD";
cout << str << endl;
return(0);
}
6) Administrateur Système
#include <stdio.h>
main()
{
char *tmp;
int i=0;
/* on y va bourin */
tmp=(char *)malloc(1024*sizeof(char)); while (tmp[i]="HELLO
WORLD"[i++]);
/* Ooopps y'a une infusion ! */
i=(int)tmp[8];
tmp[8]=tmp[9];
tmp[9]=(char)i;
printf("%s\n",tmp);
}
7) Hacker expérimenté
#include <stdio.h>
#define S "HELLO, WORLD\n"
main(){exit(printf(S) == strlen(S) ? 0 : 1);}
8) Hacker très expérimenté
% cc -o a.out ~/src/misc/bv/bv.c
% a.out
9) Gourou des Hackers
% cat
HELLO, WORLD.
^D
10) Directeur junior
10 PRINT "HELLO WORLD"
20 END
11) Directeur
mail -s "HELLO, WORLD." bob@b12
Henri, pourrais-tu m'écrire un programme
qui écrit "HELLO, WORLD." À l'écran?
J'en ai besoin pour demain.
^D
12) Directeur sénior
% zmail Jean
J'ai besoin d'un programme "HELLO, WORLD." Pour cette
après-midi.
13) Président Directeur Général
% letter
letter: Command not found.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout
_______________________________________________________
| ___ ____ |
| | \ / Address : Prefayhai, 10 B |
| | \\ B-4900 SPA E |
| | \\ Phone : (+32)87/77.24.63 L |
| |_____/ \____ G |
| Damien CORNET. Damien.Cornet@advalvas.be I |
| U |
| <http://www.stud.montefiore.ulg.ac.be/~cornetd/> M |
|____ _______________________________________________|
\ |
\ | / \
\| \^---^/
\ \ 0 0 /-----------\
| |\ |\
( o o )\ | \
--- | |-----\ | *
******************* / | *** / | ****************************
---------
Visit the Linux Supertore Online: http://www.redcorp.com !
If you want to be deleted from the list, send a mail to
majordomo@rtfm.be with "unsubscribe linux-team" in the body.