tw32115.pp 665 B

1234567891011121314151617181920212223242526
  1. {$mode objfpc}
  2. program Project1;
  3. function CalcSmth(const AValue: Integer): Integer;
  4. begin
  5. case AValue of
  6. -9999999..-1000000: Result := 2;
  7. -999999..-100000: Result := 7;
  8. -99999..-10000: Result := 5;
  9. -9999..-1000: Result := 6;
  10. -999..-100: Result := 3;
  11. -99..-10: Result := 2;
  12. -9..-1: Result := 3;
  13. 0..9: Result := 5;
  14. 10..99: Result := 2;
  15. 100..999: Result := 3;
  16. 1000..9999: Result := 1;
  17. 10000..99999: Result := 5;
  18. 100000..999999: Result := 8;
  19. 1000000..9999999: Result := 6;
  20. end;
  21. end;
  22. begin
  23. CalcSmth(0);
  24. end.