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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
| program fanta;
uses crt;
type personne=record
nom1,prenom1,nom2,prenom2:string;
end;
type dates=record
jour,mois,annee:integer;
end;
type reponse=record
oui,non:string;
end;
type message=record
expediteur,destinataire:personne;
contenu:string;
date:dates;
piece_jointe:reponse;
end;
const n=10;
var t:array[1..n] of message;
i,m,choix:integer;
p:personne;
pic:reponse;
d:dates;
nom1,nom2,prenom1,prenom2,rep,reponse1:string;
Procedure menu;
begin
repeat
writeln;
writeln;
writeln;
writeln;
writeln;
writeln('':15,'1:POUR LA SAISIE D''UN MESSAGE TAPEZ 1');
writeln;
writeln;
writeln;
writeln;
writeln;
writeln('':15,'2:POUR VOIR LE MESSAGE AU COMPLET TAPEZ 2');
writeln;
writeln;
writeln;
writeln;
writeln;
writeln('':15,'FAITES VOTRE CHOIX:');
readln(choix);
until (choix>=1) and (choix<=2);
clrscr;
end;
Procedure expediteur;
var nom2,prenom2:string;
begin
writeln('COMBIEN DE MESSAGES VOULEZ VOUS SAISIR?');
if (m <= n) then
begin
readln(m);
end
else
begin
writeln('LE NOMBRE DE MESSAGE NE DOIT PAS DEPASSER',n,'!!!');
end;
for i:=1 to m do
begin
with p do
begin
writeln('NOM EXPEDITEUR',i,' : ');readln(nom2);
writeln('PRENOM EXPEDITEUR',i,' : ');readln(prenom2);
end;
end;
end;
Procedure destinataire;
var nom1,prenom1:string;
begin
for i:=1 to m do
begin
with p do
begin
writeln('NOM DESTINATAIRE',i,' : ');readln(nom1);
writeln('PRENOM DESTINATAIRE',i,' : ');readln(prenom1);
end;
end;
end;
procedure date;
begin
for i:=1 to m do
begin
with d do
begin
writeln('SAISIE DE LA DATE');
writeln('JOUR:');readln(d.jour);
writeln('MOIS:');readln(d.mois);
writeln('ANNEE:');readln(d.annee);
writeln('LA DATE EST:',d.jour,'/',d.mois,'/',d.annee);
end;
end;
end;
procedure content;
var cont:string;
begin
for i:=1 to m do
begin
writeln('SAISISSEZ LE CONTENU DU',i,' EME MESSAGE ');readln(cont);
writeln('YA T-IL DES PIECES A JOINDRE? oui/non');readln(rep);
end;
end;
Procedure affiche;
var cont,nom1,nom2,prenom1,prenom2:string;
begin
for i:=1 to m do
begin writeln;
writeln('':20,'MESSAGE Nø',i);
with t[i] do
begin
with p do
begin
writeln;
writeln('':20,'EXPEDITEUR:',prenom2,' ',nom2);
writeln;
writeln('':20,'DESTINATAIRE:',prenom1,' ',nom1);
writeln;
writeln('':20,'DATE:',d.jour,'/',d.mois,'/',d.annee);
writeln;
writeln('':20,'MESSAGE:',cont);
writeln;
writeln('':20,'PIECE JOINTE:',rep);
writeln;
end;
end;
end;
end;
Begin
textmode(2);
textcolor(white);textbackground(magenta);clrscr;
clrscr;
begin
repeat
menu;
case choix of
1:begin
expediteur;
destinataire;
date;
content;
end;
2:begin
affiche;
end;
end;
writeln('VOULEZ VOUS CONTINUER o/n');
readln(reponse1);
until (reponse1 ='n');
end;
end. |
Partager