A
A
avenikich2021-09-07 14:46:13
Pascal
avenikich, 2021-09-07 14:46:13

How to get the last line?

I don’t understand how to get the last line in the output example, you need to use this method:

var s:string;a,b,c,d:integer;
begin
  readln(s);
  b:=length(s);
  writeln('d=',b);
  writeln('s','[',b,']','=',s[Length(s)]);
  d:=b-1;
  writeln('d-1','=',d);
  writeln('s','[',d,']','=');
end.


613750b08c0c1577282935.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HemulGM, 2021-09-07
@HemulGM

writeln('s[', d, ']=', s[6]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question