SHARE
TWEET

Untitled

a guest Feb 21st, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program gg;
  2. var a,b,c,x:integer;
  3. begin
  4.   writeln('Введите число');
  5.   read(c);
  6.   b:=0;
  7.   a:=c;
  8.     while a<>0 do begin
  9.     x:=a mod 10;
  10.     a:= a div 10;
  11.     b:=b+x;
  12.     end;
  13.   writeln ('Сумма цифр в числе ' ,c, ' равна ' ,b);
  14. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top