Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
2sdfghkl
function PosLast(substr,s :string):integer; var i,j,k,n:integer; begin k:=0; j:=1; n:=0; for i:=1 to length(s) do begin if (s[i] = substr[j]) then begin if (j=1) then k:=i; j:=j+1; if (j=length(substr)+1) then n:=n+1; end else j:=1; end; if (n<>0) then PosLast:=k else PosLast:=0; end; var s:string; begin writeln(PosLast('pos', 'pokoposkopos')); writeln(PosLast('mama','papapapapapapapapapapapapapapa')); end.
run
|
edit
|
history
|
help
0
Calculatrice 1.0
2
Registracioni broj firme
Random Numbers
practica 2 ejercicio 9
SmallQuest
BubbleSor (slimmer)
Fast program
Project Euler 20 - Factorial digit sum
practica 2 ejercicio 2