1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | CLS REM INPUT "vvedi 1 predlozenie: ", a$ currBeginPos = 0 currEndPos = 0 maxLen = 0 maxBeginPos = 0 maxEndPos = 0 FOR i = 1 TO LEN(a$) IF MID$(a$, i, 1 ) = " " THEN currEndPos = i IF currEndPos - currBeginPos > maxLen THEN maxBeginPos = currBeginPos + 1 maxEndPos = currEndPos - 1 maxLen = currEndPos - currBeginPos END IF currBeginPos = i - 1 ELSE currEndPos = i + 1 END IF NEXT i tmpStr$ = LEFT$(a$,maxBeginPos) FOR i= 1 TO maxLen - 2 tmpStr$ = tmpStr$ + "*" NEXT i tmpStr$ = tmpStr$ + RIGHT$(a$, LEN(a$) - maxEndPos) PRINT tmpStr$ |