Jater

Fedya_addition_&_multiplication_of_parts

Nov 27th, 2012
88
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var x,y,i,f,s: integer; b:boolean;
  2. begin
  3.     write('Vvedi chislo: ');
  4.     repeat
  5.         writeLN('chislo vyhodit za diapazon [1000;9999]');
  6.         write('Vvedite korrectnoe chislo: ');
  7.         readLN(x);
  8.     until (x>999)and(x<10000);
  9.     s:=1; f:=x;
  10.     for i:=0 to 3 do
  11.     begin
  12.         y:=f mod 10;
  13.         s:=s*y;
  14.         f:=f div 10;
  15.     end;
  16.     writeLN(s);
  17.     s:=0;
  18.     for i:=0 to 1 do
  19.     begin
  20.         y:=x mod 10;
  21.         s:=s+y;
  22.         x:=x div 10;
  23.     end;
  24.     for i:=0 to 1 do
  25.     begin
  26.         y:=x mod 10;
  27.         f:=f+y;
  28.         x:=x div 10;
  29.     end;
  30.     b:=s=f;
  31.     writeln(b);
  32.     readln;
  33. End.
RAW Paste Data