|
Benmars |
 |
Guru 
Déconnecté
Niveau : 5 N° de Membre :
870
Ancienneté : 100%
Participation : 13%
Inscription: 03 Apr 2002
Localisation:
Age: 55
Messages: 11324
Sujets Lancés : 780
|
Les niveaux en programmation
Cherchez votre niveau en programmation dans l'échelle suivante et tirez en les conclusions que vous voulez... L'objectif est d'écrire un programme affichant "hello world" a l'écran
Terminale
10 PRINT "HELLO WORLD"
20 END
DUT 1ere annee
program HELLO(input, output)
begin
writeln('HELLO WORLD')
end.
DUT 2eme annee
(defun HELLO
(print
(cons HELLO (list 'WORLD))))
Fraichement sorti de l'ecole
#include
void main(void)
{
char *message[] = {"HELLO ", "WORLD"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}
Professionnel tres experimente
#include
#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 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);
}

Administrateur Systeme
#include
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);
}

Apprenti Hacker
#!/usr/local/bin/perl
$msg="HELLO, WORLD.\n";
if ($#ARGV >= 0) {
while(defined($arg=shift(@ARGV))) {
$outfilename = $arg;
open(FILE, ">" . $outfilename) || die "Can't write $arg:$!\n";
print (FILE $msg);
close(FILE) || die "Can't close $arg: $!\n";
}
} else {
print ($msg);
}
1;
Hacker experimente
#include
#define S "HELLO, WORLD\n"
main(){exit(printf(S) == strlen(S) ? 0 : 1);}
Hacker tres experimente
% cc -o a.out ~/src/misc/bv/bv.c
% a.out
Gourou des Hackers
% cat
HELLO, WORLD.
^^D
Directeur junior
10 PRINT "HELLO WORLD"
20 END
Directeur
mail -s "HELLO, WORLD." bob@b12
Henri, pourrais-tu m'ecrire un programme qui ecrit
"HELLO, WORLD." a l'ecran?
J'en ai besoin pour demain.
^^D
Directeur senior
% zmail Jean
J'ai besoin d'un programme "HELLO, WORLD." Pour cette apres-midi.
President Directeur General
% letter
letter: Command not found.
% mail
To: ^^X ^^F ^^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout
__________________
Tout le monde est un génie. Mais si vous jugez un poisson sur ses capacités à grimper à un arbre, il passera sa vie à croire qu'il est stupide.
A. Einstein
Edité par Benmars le 21-03-2003 à 09:58
Signaler ce message à un modérateur | IP: Logguée Temps en ligne : 57 Jours, 6 Heures, 9 Minutes, 0 Seconde en ligne
|