program arrtest; {$APPTYPE CONSOLE} var name: string; i: Integer; begin {读入一个字符串并输出,下标从1开始} Readln(name); {Ord(name[0]) free pascal的写法,字符串第一个元素存放其长度} {length(name) object pascal的写法,需要计算其长度} for i := 1 to length(name) do Writeln(name[i]); readln; end.