• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

YOSR Apr 24th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. program bac_2018;
2. uses wincrt;
3. type tab=array[1..100] of string;
4. var m,s:tab;
5.     n:integer;
6.  Procedure saisir(var n:integer);
7.  begin
8.  writeln('entrer n');
10.  end;
11.  function verif (ch:string):Boolean;
12.  var i:Integer;
13.      msg:Boolean;
14.  begin
15.     i:=1 ;
16.     while (i<Length(ch)) and (ch[i] in ['A'..'Z',' ']) do
17.     i:=i+1;
18.     if i=Length(ch) then msg:=true else msg:=false;
19.     verif:=msg;
20.  end;
21.  Procedure remplir (var m,s:tab;n:integer);
22.  var  i,j,k,NS:integer;
23.       sym,ch:string;
24.  begin
25.     for i:=1 to n do
26.     Begin
27.     Repeat
28.     writeln('M[',i,']');
30.     until verif (M[i]);
31.     end;
32.
33.  for j:=1 to n do
34.  begin
35.  writeln('entrer le nombre de symtomes de ' , M[j]);
37.  for k:=1 to NS do
38.  begin
39.     writeln('entrer les symptomes de la maladie ',M[j]);
41.     ch:=sym+'#';
42. end;
43.     delete(ch,Length(ch),1);
44.     S[j]:=ch;
45.  end;
46. end;
47. function trouver (ch,ch1:string):Boolean;
48. var i:integer;
49.     msg:Boolean;
50.         mot:string;
51. begin
52. msg:=false;
53. i:=1;
54. while(i<=Length(ch1)) and (msg=false) do
55. begin
56. if ch1[i]=ch[1] then mot:=copy(ch1,i,Length(ch)) ;
57. if ch=mot then msg:=true else
58. i:=i+1;
59. end;
60.
61. trouver:=msg;
62.
63. end;
64. Procedure afficher (m,s:tab;n:integer);
65. var ch,ch1,sym:string;
66.     i,j:integer;
67. begin
68. ch:=' ';
69. writeln('entrer la symPtome dont vous souffrez');
71. for i:=1 to n do
72. begin
73. If Trouver (sym,S[i]) then ch:= ch + M[i] + ' ' ;
74. end;
75. writeln(ch);
76. end;
77. begin
78. saisir(n);
79. remplir(m,s,n);
80. afficher(m,s,n);
81. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Not a member of Pastebin yet?