Suma cyfr - Pascal

This commit is contained in:
2024-11-17 22:52:31 +01:00
parent 01ec66cffc
commit 19bc98b814
@@ -0,0 +1,38 @@
program suma_cyfr;
function Czytaj_liczbe : Integer;
var
liczba : Integer;
begin
write('Podaj liczbe: ');
readln(liczba);
Czytaj_liczbe:=liczba;
end;
function Suma_cyfr(liczba : Integer) : Integer;
var suma : Integer;
begin
suma:=0;
liczba:=abs(liczba);
while liczba>0 do
begin