sujet1: Correction Des Epreuves D Informatique _--Pratique--_ MEDDEB Mohamed Page 1 Devoirs et examens :

Similar documents
Correction Bac pratique 28/05/2012 8h30

Corrections proposées par Mr Adnen Smii. Propositions de correction Bac Pratique informatique 4 scientifiques -27 mai h

Correction proposée par Mr Najeh SOUGUIR 1/8

Correction bac pratique 2012 g1

SERIE N 1. 4 ème Année informatiques. Exercice 3. Exercice 4 (Manuel Scolaire) Page [1] Les enregistrements & Les fichiers Infoslpm.e-monsite.

TD 2. Correction TP info

About Transferring License Rights for. PL7 V4.5 and Unity Pro V2.3 SP1 Software

Mardi 3 avril Epreuve écrite sur un document en anglais

VLANs. Commutation LAN et Wireless Chapitre 3

Analyse statique de programmes avioniques

Ecole Nationale d Ingénieurs de Brest. Programmation par objets Le langage C++ Type Concret de Données en C++

... ; ako je a n parno. ; ako je a n neparno

The Personal Information Canadians Give to Retailers

Input parameters. Function. An ideal black-box representation of a function

ASPEN Argent / Silver

Case by Case. Chapter 3

System Controller CPU Board, Netra CompactPCI, Installation Guide. Sun Fire E25K/E20K Systems Sun Fire 15K/12K Systems

This document is a preview generated by EVS

{ -- FLORIDA HIGH SCHOOLS COMPUTING COMPETITION '83 } { -- PASCAL PROGRAM SOLUTIONS }

8.4. Mobile Platform Release Notes

Latest information prior to deployment of "Dialogys V7.5.6" Contents. What is Dialogys? How often is data updated?... 5

Laboratoire de l Informatique du Parallélisme

LVB-2 INSTRUCTION SHEET. Leakage Current Verification Box

Package CUFF. May 28, 2018

SunGigabitEthernetAdapter2.0

IEC SYSTEM FOR MUTUAL RECOGNITION OF TEST CERTIFICATES FOR ELECTRICAL EQUIPMENT (IECEE) CB SCHEME. Additional Information on page 2

SOUTH AFRICAN NATIONAL STANDARD

Oracle ZFS Storage Appliance Cabling Guide. For ZS3-x, 7x20 Controllers, and DE2-24, Sun Disk Shelves

Summary of Embroidery Patterns Résumé des motifs de broderie Resumen de diseños de bordado

WLM Accounting. User s Guide AIX ORDER REFERENCE 86 A2 76EF 00

Tutorial 4: Flow Artificial Intelligence

New Complexity Results on Array Contraction and Related Problems

SunVTS Quick Reference Card

Web Sémantique TD 1 - RDF

IEC SYSTEM FOR MUTUAL RECOGNITION OF TEST CERTIFICATES FOR ELECTRICAL EQUIPMENT (IECEE) CB SCHEME. Additional Information on page 2

SunVTS Quick Reference Card

Conception Orientée Objet. Romain Rouvoy Licence mention Informatique Université Lille 1

Préparation au concours ACM TP 2

Sun Control Station. Performance Module. Sun Microsystems, Inc. Part No September 2003, Revision A

CERTIFICAT D'ESSAI OC. Switching Power Supply XP POWER L L C RED HILL AVE, SUITE 100 TUSTIN CA 92780, USA

Scheduling Tasks Sharing Files from Distributed Repositories (revised version)

Sun Fire TM E2900 Systems Getting Started

Solaris 8 6/00 Sun Hardware Roadmap

Efficient Learning of Sparse Representations with an Energy-Based Model

Introduction to C Programming. Chih-Wei Tang ( 唐之瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan

Sun StorEdge Network 2 Gb Brocade SilkWorm 3200, 3800, and Core Fabric Switches Guide to Documentation, 3.x / Firmware

GOZO COLLEGE. Boys Secondary Victoria - Gozo, Malta Ninu Cremona. Half Yearly Examination

Sun Java System Directory Server Release Notes for HP-UX

Compilation TP 0.0 : The target architecture: Digmips

V2 2/4/ Ch Programming in C. Flow of Control. Flow of Control. Flow of control The order in which statements are executed

Switching Power Supply DELTA ELECTRONICS INC 3 TUNGYUAN RD CHUNGLI INDUSTRIAL ZONE TAOYUAN COUNTY TAIWAN

Memory Hole in Large Memory X86 Based Systems

When double rounding is odd

Using the Document Camera. Features of Interest During Operation

Flow of Control. Flow of control The order in which statements are executed. Transfer of control

Private Sub Cours_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

{ -- FLORIDA HIGH SCHOOLS COMPUTING COMPETITION '84 } { -- PASCAL PROGRAM SOLUTIONS }

REFERENCE MATERIALS. Assignment, Display, and Input Evaluates expression and assigns the result to the variable a.

Solaris 9 9/04 Installation Roadmap

Sales flow. Creation of a lead until the payment and the reminder through the consultation of the stock

Workflow Concepts and Techniques

C: How to Program. Week /Mar/05

Algorithms and Experimental Study for the Traveling Salesman Problem of Second Order. Gerold Jäger

Verification and Validation

Verification and Validation

Dolphin CT50 Non-Incendive

3/12/2018. Structures. Programming in C++ Sequential Branching Repeating. Loops (Repetition)

Quick Start. AC1200 WiFi Range Extender Model EX6150

An Introduction to MATLAB

Tutorial :.Net Micro Framework et.net Gadgeteer

Chapter 2 - Introduction to C Programming

Impact of QoS on Replica Placement in Tree Networks

Making Decisions In Pascal

EMBOUTS RONDS - ROUND FINIALS

DK UL. Ref. Certif. No. Date: Signature:

String Instructions In Cobol Delimited By Spaces

Sun Fire System Controller Board, Version 2 (Enhanced Memory) Installation Guide

Making Decisions In Pascal In this section of notes you will learn how to have your Pascal programs to execute alternatives

Read me carefully before making your connections!

LA NWM INSTALLATION. Computer requirements. Updating LA Network Manager. Saving user presets and current Session. technical bulletin - v.4.

(A) 99 ** (B) 100 (C) 101 (D) 100 initial integers plus any additional integers required during program execution

IEC SYSTEM FOR MUTUAL RECOGNITION OF TEST CERTIFICATES FOR ELECTRICAL EQUIPMENT (IECEE) CB SCHEME. Additional Information on page 2.

ALGORITHMS. Algorithms help for all these issues.

Sun Fire V60x and V65x Servers ReadMe

Sun Fire High-End Server Systems Hold-down Kit

N09/2/ABENG/SP1/ENG/TZ0/XX/Q

C-DIAS Analogue Output Module CAO 082 for eight ±10V DC respectively eight 0 20mA DC outputs

IEC SYSTEM FOR MUTUAL RECOGNITION OF TEST CERTIFICATES FOR ELECTRICAL EQUIPMENT (IECEE) CB SCHEME. Switching Power Supply for Building In

TP 2 : Application SnapTchat 20 février 2015

Cable Management Guide

Sun Java System Access Manager Release Notes for Microsoft Windows

TP7 7 Touch Panel User Interface Quick Install Guide

C-DIAS Analog Input Module CAI 086 For eight, ±10V voltage inputs

Feature-Based Facial Expression Recognition: Experiments With a Multi-Layer Perceptron

Sun Fire X4250 Volume Configuration Guide

Descriptif de communication Page 2 29 CALEC ST II KNX TP1

Software security. Chaire Informatique et sciences numériques Collège de France, cours du 6 avril 2011

Réinitialisation de serveur d'ucs série C dépannant TechNote

IPv6 Workshop: CRIHAN -Rouen 04-06/02/2014 Security Bernard TUY Thanh-Luu HA

Semantic analysis for arrays, structures and pointers

Transcription:

Correction Des Epreuves D Informatique sujet1: Program bac_2017_25_mai_s1; Uses Wincrt; Type tab = Array [1..20] Of Integer; n: Integer; T: tab; _--Pratique--_ 2017 Procedure saisir( n:integer); write('donner la taille du tableau :'); Readln(n); Until n In [3..20]; Procedure remplir( T:tab;n:Integer); For i:=1 To n Do Readln(T[i]); Until T[i]>0; Procedure afficher(t:tab;n:integer); i,s,j: Integer; ch,d,chd: string; ch := ''; j := 0; If (T[i] Mod 2=0) and (i<=n) Then Str(T[i],d); ch := ch+d+',' ; End chd := ch; s := 0; If Pos(',',chd)<>0 Then s := s+1; Delete(chd,Pos(',',chd),1); Until Pos(',',chd)=0; If (ch<>'') And (s>=2) Then j := j+1; ch := ''; Until i>n; Writeln('le nombre de séquences paires est ',j); Writeln('les séquences d''entiers pairs sont :'); ch := ''; If (T[i] Mod 2=0) and (i<=n) Then Str(T[i],d); ch := ch+d+',' ; End chd := ch; s := 0; If Pos(',',chd)<>0 Then s := s+1; Delete(chd,Pos(',',chd),1); Until Pos(',',chd)=0; If (ch<>'') And (s>=2) Then Writeln(Copy(ch,1,Length(ch)- 1)); ch := ''; Until i>n; saisir(n); remplir(t,n); afficher(t,n); End. MEDDEB Mohamed Page 1

sujet2: Program bac_2017_25_mai_s2; Uses Wincrt; n: string; Function verif(n:string): Boolean; test: Boolean; If n[i] In ['0'..'9'] Then test := True test := False; Until (Not(test)) Or (i>=length(n)); verif := (test And (Length(n)=8)); Procedure saisir( n:string); write('saisir le numero de telephone à deviner : '); Readln(n); Until verif(n); Function norepeat(ch:string): string; ch2: string; ch2 := ''; For i:=1 To Length(ch) Do If Pos(ch[i],ch2)=0 Then ch2 := ch2+ch[i]; norepeat := ch2; Procedure deviner(n:string); i,j,k: Integer; ch: string; i := 8; Writeln('vous avez ',i,' essais'); write('proposer un numéro de téléphone :'); Readln(ch); Until verif(ch); If ch<>n Then j:=0; j:=j+1; k:=0; if ch[j]<>n[j] Then k:=k+1; if (n[k]=ch[j]) And (j<>k) then Writeln(ch[j],' qui est à la position ',j,' dans la proposition n''est pas à sa bonne position'); until (k>=length(n)) or ((n[k]=ch[j]) And (j<>k)); Until j>=length(ch); i := i-1; If i<>1 Then Writeln('il vous reste ',i,' essais') Writeln('il vous reste ',i,' essai'); For j:=1 To Length(ch) Do If ch[j]=n[j] Then write(ch[j]); End write('-'); Writeln; Until (n=ch) Or (i<=1); If n<>ch Then Writeln('désolé, vous avez perdu') Writeln('bravo, vous avez gagné'); saisir(n); Clrscr; deviner(n); End. MEDDEB Mohamed Page 2

sujet3: Program bac_2017_25_mai_s3; Uses Wincrt; ch: string; p: Integer; Function verif(ch:string): Boolean; test: Boolean; If Upcase(ch[i]) In ['A'..'Z',' '] Then test := True test := False; Until (Not(test)) Or (i>=length(ch)); verif := test; Procedure saisir( ch:string); Readln(ch); Until verif(ch); Function nbmot(ch:string): Integer; i,j,n: Integer; T: Array [1..200] Of string; j := 1; If Upcase(ch[i]) In ['A'..'Z'] Then T[j] := T[j]+ch[i] j := j+1; Until i>=length(ch); n := 0; For i:=1 To j Do If T[i]<>'' Then n := n+1; nbmot := n; Function crypter(ch:string;p:integer): String; i,ordch: Integer; Chrd: string; chrd:=''; For i:=1 To Length(ch) Do If ch[i]=' ' Then Chrd :=Chrd + ch[i] If ch[i] In ['A'..'Z'] Then ordch := Ord(ch[i])+p; While not(ordch In [65..91]) Do ordch := ordch-26; Chrd :=chrd + Chr(ordch); End If ch[i] In ['a'..'z'] Then ordch := Ord(ch[i])+p; While not(ordch In [97..123]) Do ordch := ordch-26; Chrd :=chrd + Chr(ordch); crypter:=chrd; saisir(ch); p := nbmot(ch); writeln(p); Writeln(crypter(ch,p)); End. MEDDEB Mohamed Page 3

sujet4: Program bac_2017_25_mai_s4; uses wincrt; cle,init,rib:string; End. saisir(init,rib); cle:=cle_iban(init); writeln('l''iban correspondant est : ',init+cle+rib); Function verif(ch:string):boolean; if ch[i] in ['A'..'Z'] then test:=true test:=false; until (i>=length(ch)) or (not(test)); verif:=test; sujet5: Program bac_2017_25_mai_s5; uses wincrt; type tab=array [1..250] of string; tableau=array [1..250] of longint; n:integer; tb,te:tab; tbu:tableau; procedure saisir(var init,rib:string); readln(init); Until (Length(init)=2) and (verif(init)); readln(rib); until length(rib) in [10..30]; function cle_iban(init:string):string; ch,ch1:string; d,i,e:integer; ch:=''; for i:=1 to length(init) Do str(ord(init[i])-55,ch1); ch:=ch+ch1; ch:=ch+'00'; val(ch,d,e); d:=98-(d mod 97); if d<10 then d:=d*10; str(d,ch); cle_iban:=ch; Function verifb(ch:string):boolean; s, if ch[i] in ['0'..'9','#'] then test:=true else test:=false; if ch[i]='#' then s:=s+1; until (i>=length(ch)) or (not(test)); verifb:=(test) and (s=1); function veriflength(ch:string):boolean; test1,test2:boolean; p:integer; p:=pos('#',ch); if length(copy(ch,1,p-1))<=3 then test1:=true else test1:=false; if length(copy(ch,p+1,length(ch)-p))<=3 then test2:=true else test2:=false; veriflength:=(test1) and (test2); function verif(ch:string):boolean; MEDDEB Mohamed Page 4

i:integer; if ch[i] in ['0'..'9'] then test:=true else test:=false; until (not(test)) or (i>=length(ch)); verif:=test; procedure remplir(var te,tb:tab;n:integer); readln(te[i]); until (verif(te[i])) and (length(te[i])=6); readln(tb[i]); until (verifb(tb[i])) and (veriflength(tb[i])); max:=tbu[1]; for i:=2 to n Do if tbu[i]>max then max:=tbu[i]; ch:=''; if max=tbu[i] then ch:=ch+te[i]+'-'; delete(ch,length(ch),1); writeln('le besoin budgétaire le plus élevé est ',max,' D et les écoles concernées sont : ',ch); end. write('donner le nombre d''écoles à visiter :'); readln(n); until n in [2..250]; remplir(te,tb,n); generer(tb,tbu,n); afficher(te,tbu,n); procedure generer(tb:tab;var tbu:tableau;n:integer); Const p1=80; p2=160; i,p,ntableaux,ntables,e:integer; p:=pos('#',tb[i]); val(copy(tb[i],1,p-1),ntableaux,e); val(copy(tb[i],p+1,length(tb[i])-p),ntables,e); tbu[i]:=(p1*ntableaux)+(p2*ntables); procedure afficher(te:tab;tbu:tableau;n:integer); ch:string; max:longint; MEDDEB Mohamed Page 5

sujet6: Program bac_2017_25_mai_s6; uses wincrt; code:string; sujet7: Program bac_2017_25_mai_s7; Uses Wincrt; mot,masque: string; function verif(ch:string):boolean; test,test1:boolean; begin if (ch[1] in ['A'..'Z']) then test1:=true else test1:=false; i:=1; if (i>1) and (ch[i] in ['0'..'9']) then test:=true else test:=false; until (i>=length(ch)) or not(test); verif:=test and test1 and (length(ch)=12); function authentique(ch:string):boolean; d,e,i,s:integer; aux:string; str(ord(ch[1])-64,aux); delete(ch,1,1); ch:=aux+ch; for i:=1 to length(ch) Do val(ch[i],d,e); s:=s+d; authentique:=(s mod 9 = 8); repeat write('saisir le code à valider :'); readln(code); until verif(code); if authentique(code) Then writeln('c''est un billet authentique') writeln('attention! ce billet n''est pas authentique'); end. Function verif(ch:string): Boolean; test: Boolean; If (Upcase(ch[i]) In ['A'..'Z']) Then test := True test := False; Until (i>=length(ch)) Or Not(test); verif := test And (Length(ch) In [5..20]); Function masquer(ch:string): string; ch1: string; ch1 := ''; ch1 := ch1+ch[1]; For i:=1 To (Length(ch)-2) Do ch1:=ch1+'-'; ch1 := ch1+ch[length(ch)]; masquer := ch1; Procedure remplace( ch:string;ch1:string;c:char); For i:=2 To (Length(ch)-1) Do If ch1[i]=c Then ch[i] := c; Procedure deviner(mot:string; masque:string); tentative: Integer; c: Char; Writeln('le mot à deviner est ',masque); MEDDEB Mohamed Page 6

tentative := Length(mot); Writeln('il vous reste ',tentative,' essai(s)'); write('proposer un caractere :'); Readln(c); Until (Upcase(c) In ['A'..'Z']); remplace(masque,mot,c); If (masque<>mot) Then tentative := tentative-1; if tentative<>0 Then Writeln('le mot à deviner est ',masque); Until (masque=mot) Or (tentative<=0); If (tentative<=0) Then Writeln('desole, vous avez perdu ') Writeln('bravo, vous avez gagne '); writeln('le mot masqué est : ',mot); write('saisir le mot à deviner :'); Readln(mot); Until verif(mot); Clrscr; masque := masquer(mot); deviner(mot,masque); End. sujet8: Program bac_2017_25_mai_s8; Uses Wincrt; m:string; function valide(message:string):boolean; if (message[i] in ['A'..'Z',' ']) then test:=true else test:=false; until (i>=length(message)) or not(test); valide:=test and (length(message) mod 2 = 0); procedure saisir(var message:string); write('donner une chaine à coder :'); readln(message); until valide(message); function crypter(message:string):string; i,e,x1,x2,yn1,yn2:integer; yc1,yc2:char; ch,ch1,aux,mcrypte,y1,y2:string; mcrypte:=''; for i:=1 to length(message) Do if i mod 2=1 Then ch:='('; if message[i] in ['A'..'Z'] Then str(ord(message[i])-65,aux) aux:='26'; ch:=ch+aux+','; if i mod 2=0 Then if message[i] in ['A'..'Z'] Then str(ord(message[i])-65,aux) else aux:='26'; ch:=ch+aux+')'; MEDDEB Mohamed Page 7

ch1:='('; val(copy(ch,2,pos(',',ch)-1),x1,e); val(copy(ch,pos(',',ch)+1,length(ch)- pos(',',ch)-1),x2,e); str((((11*x1)+(3*x2)) mod 27),y1); str((((7*x1)+(4*x2)) mod 27),y2); ch1:=ch1+y1+','+y2+')'; if y1='26' then yc1:=' ' else val(copy(ch1,2,pos(',',ch1)- 1),yn1,e); yc1:=chr(yn1+65); mcrypte:=mcrypte+yc1; if y2='26' then yc2:=' ' val(copy(ch1,pos(',',ch1)+1, length(ch1)-pos(',',ch1)-1),yn2,e); yc2:=chr(yn2+65); mcrypte:=mcrypte+yc2; crypter:=mcrypte; end. saisir(m); writeln(crypter(m)); sujet9: program bac_2017_25_mai_s9; uses wincrt; Type tableau=array [1..100] of string; tab=array[1..100] of real; TC:tableau; TN:tab; N:integer; procedure saisir(var n:integer); write('donner le nombre de participants :'); readln(n); until n in [5..100]; function verifgov(ch:string):boolean; if ch='' then test:=false if upcase(ch[i]) in ['A'..'Z'] then test:=true else test:=false; until not(test) or (i>=length(ch)); verifgov:=test and (length(ch)<=15); function verif(ch:string):boolean; test1,test2,testotal:boolean; if ch[i] in ['A'..'Z'] then test1:=true else test1:=false; until (i>=3) or not(test1); if test1=false then testotal:=false else MEDDEB Mohamed Page 8

if ch[i] in ['0'..'9'] then test2:=true else test2:=false; until not(test2) or (i>=length(ch)); testotal:=test1 and test2; verif:=(length(ch)=6) and testotal; function npr(tn:tab;n:integer):integer; i,s:integer; if TN[i]>=10 then s:=s+1; npr:=s; function ntpg(tn:tab;tc:tableau;gov:string;n:integer):integer; ch:string; i,j,s:integer; ch:=''; for j:=1 to 3 Do ch:=ch+upcase(gov[j]); if (ch=copy(tc[i],1,3)) then s:=s+1; ntpg:=s; function nprg(tn:tab;tc:tableau;gov:string;n:integer):integer; i,j,s:integer; ch:string; ch:=''; for j:=1 to 3 Do ch:=ch+upcase(gov[j]); s:=s+1; if (ch=copy(tc[i],1,3)) and (TN[i]>=10) then nprg:=s; procedure remplir(var TC:tableau;var TN:tab;n:integer); readln(tc[i]); Until verif(tc[i]); readln(tn[i]); until (TN[i]>=0) and (TN[i]<=20); procedure afficher(tc:tableau;tn:tab;n:integer); TRG,TRN:real; gov:string; TRN:=(npr(TN,n)/n)*100; writeln('le taux de reussite national est de ',TRN:5:2,' %'); readln(gov); until verifgov(gov); TRG:=((nprg(TN,TC,gov,n)/ntpg(TN,TC,gov,n))*100); writeln('le taux de reussite de ',gov,' est ',TRG:5:2,' %'); begin end. saisir(n); remplir(tc,tn,n); afficher(tc,tn,n); MEDDEB Mohamed Page 9

sujet10: program bac_2017_25_mai_s10; uses wincrt; Type tab=array [1..1000] of string; tableau=array [1..1000] of integer; ch:string; function valide(ch:string):boolean; test:=false; if ch<>'' Then if ch[i] in ['a'..'z'] then test:=true else test:=false; until (not(test)) or (i>=length(ch)); valide:=(test and (ch<>'') and (length(ch)>=2)); Procedure saisir(var ch:string); write('donner une chaine: '); readln(ch); until valide(ch); function existence(t:tab;ch:string;j:integer):boolean; if T[i]=ch then test:=true else test:=false; until (i>=j) or test; existence:=test; procedure afficher(ch:string); T:tab; Toc:tableau; i,j,k,l,s:integer; j:=0; for i:=1 to length(ch)-1 Do if (ch[i]<>ch[i+1]) Then if j<>0 Then if not(existence(t,ch[i]+ch[i+1],j)) Then s:=s+1; j:=j+1; T[j]:=ch[i]+ch[i+1]; End j:=j+1; T[j]:=ch[i]+ch[i+1]; if j<>0 Then for k:=1 to j Do for l:=1 to (length(ch)-1) Do if T[k]=(ch[l]+ch[l+1]) then ',T[k],' est ',Toc[k]); end. saisir(ch); afficher(ch); Toc[k]:=s; writeln('le nombre d''occurences de MEDDEB Mohamed Page 10