Advertisement
ProToTN

Untitled

Feb 9th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.49 KB | None | 0 0
  1. uses wincrt;
  2. type Tab=array[1..12] of char;
  3. var T:Tab;i,N,NB1,NB2:Byte;{Byte can be replaced with Integer}
  4. Begin
  5.   Repeat
  6.     writeln('N: ');
  7.     readln(N);
  8.   Until N>0;
  9.   For i:=1 to N do
  10.   Begin
  11.     Repeat
  12.       writeln('T[',i,']= ');
  13.       readln(T[i]);
  14.     Until (T[i] in ['a'..'z','A'..'Z']);
  15.   End;
  16.   NB1:=0;
  17.   NB2:=0;
  18.   For i:=1 to N do
  19.   Begin
  20.     if T[i] in ['a'..'z'] then
  21.     NB1:=NB1+1
  22.     else NB2:=NB2+1;
  23.   End;
  24.   writeln('NB1= ',NB1);
  25.   writeln('NB2= ',NB2);
  26. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement