Determine count char a in sentence
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Author: Juraj Pupák
Program: Pismenoa.pas
File exe: Pismenoa.exe
Author: Juraj Pupák
Program: Pismenoa.pas
File exe: Pismenoa.exe
Determine count char a in sentence.
{ PISMENOA.PAS } { Zisti kolkokrat sa vo vete nachadza pismeno A. } { } { Author: Juraj Pupak } { Date : 27.10.2006 http://www.trsek.com } program Pismeno_a; uses crt; var Cstr_veta : string; Cstr_1 : string; dlzka_vety : integer; index : integer; pocet_pismen_a : integer; begin clrscr; writeln('Zadaj vetu ukoncenu bodkou'); readln(Cstr_veta); clrscr; dlzka_vety := length(Cstr_veta); For index := 1 To dlzka_vety Do begin Cstr_1 := Cstr_veta[index]; IF Cstr_1 = 'a' THEN begin pocet_pismen_a := pocet_pismen_a + 1; end; end; writeln('Pocet pismen "a" sa vo vete nachadza ',pocet_pismen_a,' krat'); readln; end.