1 / 14

Interschimbarea a doua silabe intr -o propozi t ie

Interschimbarea a doua silabe intr -o propozi t ie. Bob Anamaria Cl a-XI-a C. Problema. Se cieste de la tastatura un text de maxim 40 de caractere sa se afiseze textul dupa inter s chimbar ea silabei ‘ oa ’ cu silaba ‘ ie ’. Variabile.

Download Presentation

Interschimbarea a doua silabe intr -o propozi t ie

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. Interschimbarea a douasilabeintr-o propozitie Bob Anamaria Cl a-XI-a C

  2. Problema • Se cieste de la tastatura un text de maxim 40 de caracteresa se afisezetextul dupa interschimbareasilabei‘oa’ cu silaba ‘ie’

  3. Variabile • text – estepropozitia ce se introduce de la tastaura este de tip string; • silaba1 – este silabacare trebuie identificata in cadrul propozitiei si este de tip string; • silaba2 – este silaba care va inlocui de silaba1 in propoziţie ; • P – poziţea silaba1 in cadrul propoziţiei • L – lungimea silabei1;

  4. Pseudocod • Se citeste textul de la tastatură: Soarelescoatepeogoareoamenii. • Se cautapecepozitie e prima silaba ‘oa’ in cadrultextulcitit care se retine in variabila p. • Se stergeincepand cu pozitia p silaba ’oa’ • Sa se adaugeincepand cu pozitia p silaba ‘ie’ • l:=2;

  5. 2 3 oa p:=2; 1 4 5 6 7 8 9 10 11 12 13 14 15 1617 18 19 20 2122 23 24 25 26 27 2829 30 31 S relescoatepeogoareoamenii. oa Delete

  6. 2 3 ie p:=2; 1 4 5 6 7 8 9101112 1314 15 1617 1819 20 21222324 25 2627 28 29 30 31 32 S relescoatepeogoareoamenii. ie Insert

  7. 11 12 oa p:=11; 1 2 3 4 5 6 8 9 10 1314 15 1617 1819 20 21222324 25 2627 28 29 30 31 32 Sierele sc tepeogoareoamenii. oa Delete

  8. 11 12 ie p:=11; 1 2 3 4 5 6 8 9 10 1314 15 1617 18 19 20 21222324 25 2627 28 29 30 31 32 Sierele sc tepeogoareoamenii. ie Insert

  9. 21 22 oa p:=21; 1 2 3 4 5 6 8 9 10 11 12 1314 15 1617 18 19 20 2324 25 2627 28 29 30 31 32 Sierelescietepeog re oamenii oa Delete

  10. 21 22 ie p:=21; 1 2 3 4 5 6 8 9 10 11 12 1314 15 1617 18 19 20 2324 25 2627 28 29 30 31 32 Sierelescietepeog re oamenii ie Insert

  11. 26 27 oa p:=26; 1 2 3 4 5 6 8 9 10 11 12 1314 15 1617 18 19 2021 22 2324 25 28 29 30 31 32 Sierelescietepeogieremenii oa Delete

  12. 26 27 ie p:=26; 1 2 3 4 5 6 8 9 10 11 12 1314 15 1617 18 19 2021 22 2324 25 28 29 30 31 32 Sierelescietepeogieremenii ie Insert

  13. Textuldupainterschimbareeste : Sierelescietepeogiereiemenii.

  14. Program Pascal Program silaba; var text,silaba1,silaba2:string; l,p:integer; Begin write(‘text=‘);readln(text); write(‘silaba1=‘);readln(silaba1); write(‘silaba2=‘);readln(silaba2); l:=length(silaba1); P:=pos(silaba1,text); While p<>0 do Begin delete(silaba1,p,l); insert(silaba2,text,p); p:=pos (sliaba1,text); End; Writeln(‘textuldupainterschimbareeste ’,text); Readln; End.

More Related