Niezalogowany (Zaloguj się)
WItaj Gościu! Możesz się teraz zalogować lub poprosić o członkowstwo na Forum Turbo Pascal Web Pag
    • CommentAuthorklawir
    • CommentTime18 Apr 2010
     
    Witam. Mam problem z napisaniem programu, który będzie liczyć litery alfabetu i cyfry. Próbowałem sam odszukać ten błąd, ale się już pogubiłem. Oto struktura tego programu w TP: program wpascal; uses crt; var tablica:array[1..26] of integer; tekst:string; dl,i,j,litera:integer; begin ClrScr; writeln('Podaj tekst '); readln(tekst); dl:=length(tekst); for i:=1 to 26 do tablica:=0; for i:=1 to dl do begin if (tekst[i]='a') or (tekst[i]='A') then tablica[1]:=tablica[1]+1; if (tekst[i]='b') or (tekst[i]='B') then tablica[2]:=tablica[2]+1; if (tekst[i]='c') or (tekst[i]='C') then tablica[3]:=tablica[3]+1; if (tekst[i]='d') or (tekst[i]='D') then tablica[4]:=tablica[4]+1; if (tekst[i]='e') or (tekst[i]='E') then tablica[5]:=tablica[5]+1; if (tekst[i]='f') or (tekst[i]='F') then tablica[6]:=tablica[6]+1; if (tekst[i]='g') or (tekst[i]='G') then tablica[7]:=tablica[7]+1; if (tekst[i]='h') or (tekst[i]='H') then tablica[8]:=tablica[8]+1; if (tekst[i]='i') or (tekst[i]='I') then tablica[9]:=tablica[9]+1; if (tekst[i]='j') or (tekst[i]='J') then tablica[10]:=tablica[10]+1; if (tekst[i]='k') or (tekst[i]='K') then tablica[11]:=tablica[11]+1; if (tekst[i]='l') or (tekst[i]='L') then tablica[12]:=tablica[12]+1; if (tekst[i]='m') or (tekst[i]='M') then tablica[13]:=tablica[13]+1; if (tekst[i]='n') or (tekst[i]='N') then tablica[14]:=tablica[14]+1; if (tekst[i]='o') or (tekst[i]='O') then tablica[15]:=tablica[15]+1; if (tekst[i]='p') or (tekst[i]='P') then tablica[16]:=tablica[16]+1; if (tekst[i]='q') or (tekst[i]='Q') then tablica[17]:=tablica[17]+1; if (tekst[i]='r') or (tekst[i]='R') then tablica[18]:=tablica[18]+1; if (tekst[i]='s') or (tekst[i]='S') then tablica[19]:=tablica[19]+1; if (tekst[i]='t') or (tekst[i]='T') then tablica[20]:=tablica[20]+1; if (tekst[i]='u') or (tekst[i]='U') then tablica[21]:=tablica[21]+1; if (tekst[i]='v') or (tekst[i]='V') then tablica[22]:=tablica[22]+1; if (tekst[i]='w') or (tekst[i]='W') then tablica[23]:=tablica[23]+1; if (tekst[i]='x') or (tekst[i]='X') then tablica[24]:=tablica[24]+1; if (tekst[i]='y') or (tekst[i]='Y') then tablica[25]:=tablica[25]+1; if (tekst[i]='z') or (tekst[i]='Z') then tablica[26]:=tablica[26]+1; end; writeln; for j:=1 to 26 do begin if tablica[j]<>0 then begin litera:=j+64; writeln('Litera ', chr(litera), ' wystepuje ',tablica[j],' razy.'); end; end; readln; end. Pomoże mi ktoś?
  1.  
    Potrzebuje pilnej pomocy z zadaniami z Turbo Pascala.To zależy w dużej mierze od mojej oceny. Oto zadania. 1.Narysuj schemat blokowy poniższego algorytmu: z:=8; i:=3; If z>i Then a:=7 mod 2 Else a:=7 mod 2; 2.Narysuj schemat blokowy poniższego algorytmu: if x<=l then if y<2 then f := x*y-2 else f := x+y else f := 2*x+y; Jeszcze to bardzo potrzebuje na środę. 3.Narysuj schemat blokowy instrukcji: CASE miesiac OF 6 : m :='CZERWIEC'; 7 : m :='LIPIEC'; 8 : m :='SIERPIEN'; Ele writeln (‘to już nie lato!’); END; Bardzo pilne.