👤

Se citesc trei numre x, y, z. Sa se verifice daca cele trei numere citite sunt consecutive in multimea numerelor naturale, afisand un mesaj corespunzator.

AJUTOR VA ROG !!!
Dau coroană !


Răspuns :

Răspuns:

var x, y, z : integer;

begin

 write('Introduceti valorile celor trei numere x, y, z: ');readln(x,y,z);

 if (x=pred(y)) and (y=pred(z)) then writeln('Sunt consecutive in multimea N')  

 else if (x=succ(y)) and (y=succ(z)) then writeln('Sunt consecutive in multimea N')

 else writeln('Nu sunt consecutive in multimea N');

end.