fork download
  1. program enigmath;
  2. Uses Math;
  3. const MAXX=102;
  4. var
  5. Emin, Emax, E, i, S, K, t, sum, a : longint;
  6. cod, dec :array[1..1000000] of Longint;
  7.  
  8. function sommacifre (x:Longint):Longint;
  9. var somma:Longint;
  10. begin
  11. somma:=0;
  12. while x>=1 do
  13. begin
  14. somma:=somma + (x mod 10);
  15. x:=x div 10;
  16. end;
  17. sommacifre:=somma;
  18. end;
  19. begin
  20. {
  21.   uncomment the following lines if you want to read/write from files
  22.   assign(input, 'input.txt'); reset(input);
  23.   assign(output, 'output.txt'); rewrite(output);
  24. }
  25.  
  26. readln(Emin, Emax);
  27. for i:=Emin to Emax do begin a:=sommacifre(i);writeln(i-a ); end;
  28. end.
Success #stdin #stdout 0s 5256KB
stdin
42 42
stdout
36