2,0,334
Объяснение:
Excel VBA
Function newstr(str As String, n As Integer) As String
Dim i As Integer
For i = 1 To n
str = Replace(str, "a", "ab")
str = Replace(str, "bb", "c")
Next
newstr = str
End Function
Function chrcount(str1 As String, str2 As String) As Integer
Dim str() As String
str = Split(str1, str2)
chrcount = UBound(str, 1)
End Function
После вызова из ячейки функции
= chrcount(newstr("abab"; 333); "a")&","&chrcount(newstr("abab"; 333); "b")&","&chrcount(newstr("abab"; 333); "c")
получаем результат:
2,0,334
var c:char;
begin
write('Введите символ: ');
readln(c);
case c of
'0'..'9' :writeln('digit');
'A'..'Z','a'..'z':writeln('lat');
'А'..'Я','а'..'я':writeln('rus');
else writeln('Другой символ');
end;
end.
Пример:
Введите символ: П
rus