Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  lol
Language: PASCAL
Code:
program palindromo;
type vet=array[1..10]of integer;

procedure lettura(var a:vet);
var
     i:integer;
begin
for i:=1 to 10 do
     readln(a[i]);
end;

function palindromo( a:vet ):string;
var
     i,k:integer;
begin
     repeat
          if a[i]=a[5+1-i]      then
                                        i:=i+1
                                     else
                                        k:=1
     until (a[i]=a[5+1-i]) and (i=5 div 2) and (k<>0);
          if k=1 then
                    palindromo:='nonpalindromo'
                    else
                    palindromo:='palindromo';
end;

var
     a:vet;
begin
     lettura(a);
     writeln(palindromo(a));
end.         
          
Comments: