Проверьте программу, кто хорошо разбирается в программировании.
Program P7;
var S:String; k,c,n,i,v:byte;
T:string
Begin
Write ('na ulite sneg');
readln (S);
n:=legth (S);
For i:=1 to n do
case S[I] of
' ':k:=k+1;
end;
Writeln ('kolicestvo clov,'k);
For i:=1 to n do
case S[I] of
',' , ';' , '.' , '!' ,':', '
end;
Writeln ('kolicestvo znakov prepinania',k);
For I:=1 to n do
case S[c] of
'b','c','d','f','g','k','l','m','n','p','r','s',t':k :=k+1
writeln('kolicestvo soglasnih, k);
readkey
end.
Answers & Comments
Verified answer
Program P7;var S:String; n,k1,k2,k3,i:byte;
Begin
writeln('Введите строку:');
readln (S);
n:=length (S);
k1:=0; k2:=0; k3:=0;
For i:=1 to n do
case S[I] of
' ' : k1:=k1+1;
',',';','.','!',':','?' : k2:=k2+1;
'b','c','d','f','g','k','l','m','n','p','r','s','t': k3:=k3+1
end;
Writeln ('kolicestvo clov = ',k1+1);
Writeln ('kolicestvo znakov prepinania = ',k2);
writeln('kolicestvo soglasnih = ', k3);
readkey
end.
Пример:
Введите строку:
na ulite sneg.
kolicestvo clov = 3
kolicestvo znakov prepinania = 1
kolicestvo soglasnih = 6