|
zadach30.BAS |
|
{* Задача30 *}REM basic ' Выделить первый слог в слове, в котором не менее двух слогов. Заранее спасибо.DEFINT A-Z
Dim S As String, Sh As String
CLS
INPUT "Vvedite slovo : ", S
S = LCASE$(S)
Sh = "aeiouy"
For i = 1 To LEN(S)
If k < 2 Then
For j = 1 To LEN(Sh)
If Mid$(S, i, 1) = Mid$(Sh, j, 1) Then k = k + 1: c = i: Exit For
Next
If k = 1 Then c2 = i - 1
End If
If k = 2 Then
k = 0
For l = c - 1 To c - 2 Step -1
If l > 0 Then
f = 1
For j = 1 To LEN(Sh)
If (l > 0) And ( Mid$(S, l, 1) = Mid$(Sh, j, 1)) Then f = 0: t = l
Next
k = k + f
End If
Next
If t = c - 1 Then PRINT "Oshibka! Glasnye dolgny razdelatsa soglasnimi."
If k = 1 Then c = c2: GoTo 5
If k = 2 Then c = c - 2: GoTo 5
Exit For
End If
Next
PRINT "Slog ne naiden!"
End
5 PRINT "Pervij slog : "; LEFT$(S, c)
End
|