Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program project1;
- var
- tablica : array [0..3] of char;
- i, licznik : integer;
- znak : char;
- function ile_malych(tablica : array of char) : integer;
- begin
- licznik := 0;
- for i:=0 to 10 do
- if (tablica[i] in ['a'..'z']) then licznik := licznik +1;
- ile_malych:= licznik;
- end;
- function ile_znak(tablica : array of char; znak : char) : integer;
- begin
- ile_znak:=0;
- for i:=0 to 10 do
- begin
- if (tablica[i] = znak) then ile_znak := ile_znak +1;
- end;
- end;
- function suma( tablica: array of char):integer;
- begin
- suma:=0;
- for i:=0 to 10 do
- begin
- if (tablica[i] in ['0'..'9']) then suma:= suma+(integer(tablica[i])-integer('0')) ;
- end;
- end;
- begin
- for i:=0 to 3 do
- Readln(tablica[i]);
- for i:=0 to 3 do
- Writeln(tablica[i]);
- writeln(#10#13, 'Liczba malych liter: ', ile_malych(tablica));
- writeln(' Podaj znak: ');
- readln (znak);
- writeln(#10#13, 'o podanym znaku jest: ', ile_znak(tablica, znak));
- writeln(#10#13, 'suma: ', suma(tablica));
- readln();
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement