[Débutant] Utilisation de If
Bonjour, j'ai commencé il y a peu le Pascal, et j'ai fait un code, mais il ne marche pas :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
Program Lolo ( output );
var fille : String;
var cl : String;
var lunettes : String;
var cn : String;
var tans : String;
begin
writeln('Merci d''ecrire sans maj');
writeln('Est-ce que tu es une fille ? Oui ou Non ');
readln(fille);
writeln('Est-ce que tu as les cheveux longs ? Oui ou Non');
readln(cl);
writeln('Est-ce que tu as des lunettes de vue ? Oui ou Non ');
readln(lunettes);
writeln('Est-ce que tu as les cheveux noirs ? Oui ou Non');
readln(cn);
writeln('Est-ce que tu as plus de trente ans ? Oui ou Non ');
readln(tans);
if (fille = 'non' and cl = 'non' and lunettes = 'non' and cn = 'non' and tans = 'non')
then
begin
writeln('Tu es un(e) petit(e) homme/femme qui dit non');
end
else
if (fille = 'oui' and cl = 'oui' and lunettes = 'oui' and cn = 'oui' and tans = 'oui')
then
begin
writeln('Tu es une personne qui dit oui');
end
else
if (fille = 'non' and cl = 'non' and lunettes = 'oui' and cn = 'non' and tans = 'non')
then
begin
writeln('Tu es Elliot Gaud Morel');
end
else
if (fille = 'oui' and cl = 'oui' and lunettes = 'non' and cn = 'non' and tans = 'oui')
then
begin
writeln('Tu es ma maman que j''aime');
end
else
if (fille = 'non' and cl = 'non' and lunettes = 'oui' and cn = 'oui' and tans = 'oui')
then
begin
writeln('Tu es Bertrand Boudaud');
end
else
if (fille = 'oui' and cl = 'oui' and lunettes = 'non' and cn = 'non' and tans = 'non')
then
begin
writeln('Tu es Heloise Gaud Morel');
end
else
if (fille = 'oui' and cl = 'non' and lunettes = 'non' and cn = 'oui' and tans = 'non')
then
begin
writeln('Tu es Marie Boudaud');
end
else
begin
writeln('Je ne te connais pas');
end;
writeln('Copyright 2008-2009 LaE');
readln;
end. |
Cordialement, le if ne marche pas.