var Str: string; C: Char; I: Integer;begin Str := 'level'; for C in Str do WriteLn(C); //按索引遍历:从 1 开始 for I := 1 to Length(Str) do WriteLn('str[', I, '] = ', Str[I]);end.