1 / 10

Proiect informatica

Proiect informatica. PR ELUCRAREA RECURSIVA A STRINGURILOR. `` Cand statul nu plateste profesorii , copiii sunt cei care vor plati ``. Grupa nr. 4. Realizatori : Scridon Raluca Borzasi Madalina Buburuz Andra Goja Razvan Profesor : Tomsa Gelu.

Download Presentation

Proiect informatica

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Proiectinformatica

  2. PRELUCRAREA RECURSIVA A STRINGURILOR • `` Candstatul nu platesteprofesorii , copiiisuntcei care vorplati ``

  3. Grupa nr.4 • Realizatori: • ScridonRaluca • BorzasiMadalina • BuburuzAndra • GojaRazvan • Profesor: • TomsaGelu

  4. 1).Scrieti o functie recursiva care citeste caracterele si le afiseaza in ordinea inversa citirii.Sfarsitulsirului este marcat de caracterul # • procedure p; var c:char; Begin Read(c); If c=‘#’ then writeln Else Begin p; Write(c); End; End. Begin p; Readln; End.

  5. 2).Afisatitoateprefixeleurm. cuvant: ABC AB A • Var s:string; Begin readln(s) For i=1 to length(s) do Writeln(copy(s , 1, i)) End.

  6. 3).Afisatitoatesufixeleurm. cuvant: ABC BC C • Var s:string Begin readln(s) for i:=1 to length(s) do Writeln(copy(s, length(s)-i+1, i)); End.

  7. 4).Afisatitoatesecventele ….unuicuvant ABCDE BCD C • Var s:string; i:integer; begin readln(s); While length (s)>0 do Begin writeln(s); Delete (s,i,1); If(length(s)>0) then delete (s,length(s),1) End; End.

  8. 5).Se citeste un cuvant. Sa se afisezetoatecuvinteleobtinuteprineliminareaunuisingurcaracter din cuvantul dat. • Vars,t:string [40] i:integer; Begin readln (s); For i:=1 to length(s) do Begin t:=s; Delete (t,i,1) Writeln(s); End; End.

  9. 6).Se da un string s. Sa se numerecatevocalecontinesirulfolosind o functieinterativasiunarecursiva. • Var s:set of char; Begin readln(s); If s[i] [‘A’,’E’,’I’,’O’,’U’] then nr:=nr+1; Write (nr); End.

  10. 7).Se citeste un cuvant de la tastatura.Verificatidaca un sir estepalindrom. • Function polindrom(s:string):boolean; Begin if i≥n-i+1 then polindrom:=true Else if s[i]=s[n-i+1] then polindrom:=polindrom(i+1;n) End.

More Related