BYTE FUNC IsCycle(CHAR ARRAY s,sub) BYTE i,j,count IF sub(0)=0 OR s(0)sub(0) THEN j=1 count==+1 FI OD IF count>1 THEN RETURN (1) FI RETURN (0) PROC Test(CHAR ARRAY s) CHAR ARRAY sub BYTE len,count PrintF("%S -> ",s) count=0 FOR len=1 TO s(0)-1 DO SCopyS(sub,s,1,len) IF IsCycle(s,sub) THEN IF count>0 THEN Print(", ") FI Print(sub) count==+1 FI OD IF count=0 THEN Print("none") FI PutE() RETURN PROC Main() Test("1001110011") Test("1110111011") Test("0010010010") Test("1010101010") Test("1111111111") Test("0100101101") Test("0100100") Test("101") Test("11") Test("00") Test("1") RETURN