функция для определения позиции буквы в слове ,не могу найти ошибку.

var slovo :string;
     i :integer;
function ups(var s :string; ch :char):integer;
var i,n :integer;
  begin
  for i:=1 to length(s) do
  if s[i]=ch then n:=i
  else n:=0;
  ups:=n;
  end;
begin
   writeln('vvedite slovo');
readln(slovo); writeln('N = ',ups(slovo,a));
end.
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Copyright © 2024 SCHOLAR.TIPS - All rights reserved.