program UchXonaliSonRaqamlarYigindisi;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
son, yuzlik, onlik, birlik, yigindi: Integer;
begin
// Foydalanuvchidan uch xonali sonni kiritishni so'raymiz
Write('Uch xonali sonni kiriting: ');
ReadLn(son);
// Tekshirish: Uch xonali son kiritilganligini ta'minlash
if (son < 100) or (son > 999) then
begin
WriteLn('Iltimos, uch xonali son kiriting!');
Exit;
end;
// Raqamlarni ajratamiz
yuzlik := son div 100;
onlik := (son div 10) mod 10;
birlik := son mod 10;
// Raqamlar yig'indisini hisoblash
yigindi := yuzlik + onlik + birlik;
// Natijani chop etish
WriteLn('Raqamlar yig''indisi: ', yigindi);
// Konsolni yopmaslik uchun keyingi qadamni kutamiz
ReadLn;
end.
cHJvZ3JhbSBVY2hYb25hbGlTb25SYXFhbWxhcllpZ2luZGlzaTsKCnskQVBQVFlQRSBDT05TT0xFfQoKdXNlcwogIFN5c1V0aWxzOwoKdmFyCiAgc29uLCB5dXpsaWssIG9ubGlrLCBiaXJsaWssIHlpZ2luZGk6IEludGVnZXI7CmJlZ2luCiAgLy8gRm95ZGFsYW51dmNoaWRhbiB1Y2ggeG9uYWxpIHNvbm5pIGtpcml0aXNobmkgc28ncmF5bWl6CiAgV3JpdGUoJ1VjaCB4b25hbGkgc29ubmkga2lyaXRpbmc6ICcpOwogIFJlYWRMbihzb24pOwoKICAvLyBUZWtzaGlyaXNoOiBVY2ggeG9uYWxpIHNvbiBraXJpdGlsZ2FubGlnaW5pIHRhJ21pbmxhc2gKICBpZiAoc29uIDwgMTAwKSBvciAoc29uID4gOTk5KSB0aGVuCiAgYmVnaW4KICAgIFdyaXRlTG4oJ0lsdGltb3MsIHVjaCB4b25hbGkgc29uIGtpcml0aW5nIScpOwogICAgRXhpdDsKICBlbmQ7CgogIC8vIFJhcWFtbGFybmkgYWpyYXRhbWl6CiAgeXV6bGlrIDo9IHNvbiBkaXYgMTAwOwogIG9ubGlrIDo9IChzb24gZGl2IDEwKSBtb2QgMTA7CiAgYmlybGlrIDo9IHNvbiBtb2QgMTA7CgogIC8vIFJhcWFtbGFyIHlpZydpbmRpc2luaSBoaXNvYmxhc2gKICB5aWdpbmRpIDo9IHl1emxpayArIG9ubGlrICsgYmlybGlrOwoKICAvLyBOYXRpamFuaSBjaG9wIGV0aXNoCiAgV3JpdGVMbignUmFxYW1sYXIgeWlnJydpbmRpc2k6ICcsIHlpZ2luZGkpOwoKICAvLyBLb25zb2xuaSB5b3BtYXNsaWsgdWNodW4ga2V5aW5naSBxYWRhbW5pIGt1dGFtaXoKICBSZWFkTG47CmVuZC4K