0% found this document useful (0 votes)
26 views

Lucrare de Laborator NR 5 Tema:: Prelucrarea Sirurilor de Caractere

This document contains a laboratory work assignment on string processing in Moldovan. It provides the task of reversing a character string using classic array reversal principles. It also gives a program listing to find and remove repeated words in a string. The conclusion discusses how the author used classic array techniques and functions like strlen and strcmp to manipulate strings in the programs and reinforce theoretical knowledge from lectures.

Uploaded by

Kenneth Edwards
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Lucrare de Laborator NR 5 Tema:: Prelucrarea Sirurilor de Caractere

This document contains a laboratory work assignment on string processing in Moldovan. It provides the task of reversing a character string using classic array reversal principles. It also gives a program listing to find and remove repeated words in a string. The conclusion discusses how the author used classic array techniques and functions like strlen and strcmp to manipulate strings in the programs and reinforce theoretical knowledge from lectures.

Uploaded by

Kenneth Edwards
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Ministerul Educatiei al Republicii Moldova Universitatea Tehnica a Moldovei Facultatea Inginerie si Management in Electronica si Telecomunicatii.

La disciplina:Programare

Lucrare de Laborator nr 5 Tema Prelucrarea sirurilor


de caractere.

! e"ectuat st. gr. #$E%&'& ! veri"icat I. sup.

(orman (orneliu (hihai !ndrei

(hisinau ')&*

Varianta 11 1 Sarcina:
Este dat un sir de caractere .+e inversat sirul "olosind principiile clasice de inversare a masivelor.

a) Schema logica
start

&
clrscr ,uts I.) I/n I00

-ets

6.a3i4

#trlen

a 3i4.a3 4

R.)

a 3 4 .6

1.) getch & end I" 2 3r4 354 I" 2 3r4 354

I.) I/n I00

b)Listingul programului
7 include /string.h8 7 include /stdio.h8 7 include /math.h8 7 include /conio.h8 void main 9 : ; char a3')4<g3')4<au=> int i<n<?<5> puts 9culege un sir de caractere @n :> gets 9a:> n.strlen 9a:>?.)> "or 9i.)>i/nA'>i00:; au=.a3i4 > a3i4.a3n%i4> a3n%i4.au=>B print" 9masivul "inal este @n:> getch 9 :>B

2 Conditiile problemei
Este dat un sir normal . +e sters din sir cuvintele ce se repeat.
start &
clrscr ,uts
I.) I/n I00

-ets

I" 2 3r4 354

#trlen

I" R.) 2 3r4 354

1.)

' &

'
I.) I/n I00

print"

(.=3i4
D.i0& D/r D00

I.) I/ I00

print" 1.E

i" (00

getch

end i" F3h4.c

b)Listingul programului
7 include /string.h8 7 include /stdio.h8 7 include /math.h8 7 include /conio.h8 void main 9 : ; char c<b35)4 35)4> int e.)<h.)<i<C<m<n> clrscr 9 :> puts 9culege un sir de caractere @n :> gets 9s:> n.strlen 9s:>?.)> "or 9i.)>i/n>i00:;

(.=3i4> "or 9C.C0&>C/m>C00:; 5.strcmp9c<=3C4:> i" 95. .): e00>B i" 9e.):;b3h4.c>h0>BE.) >B print" 9@n sirul nou este @n:> "or 9i.)>i/c'>i00:> print" 9Gs<b3i4:> getch 9 :>B

3 Concluzii
(u aCutorul acestor programe noi am prelucrat si am operat cu sirurile de caractere "olosind principii clasice de inversare a masivelor . In acest program noi am "olosit instructiuni si "unctii descrie in punctul 8 +atorita acestei lucrari de laborator eu miam intarit cunostintele teoretice primite la perechile de curs .

You might also like