fork download
  1. Function BarkodOlustur1(Bar12Hane:String ):String;
  2. Var
  3. tek_toplam,
  4. cift_toplam,
  5. tum_toplam,
  6. i : Integer;
  7. begin
  8. tek_toplam := 0;
  9. cift_toplam := 0;
  10. tum_toplam := 0;
  11. For i := 1 to Length(Bar12Hane) do begin
  12. If i mod 2 <> 0
  13. then tek_toplam := tek_toplam + (StrToInt(Bar12Hane[i])*1)
  14. else cift_toplam := cift_toplam + (StrToInt(Bar12Hane[i])*3);
  15. end;
  16. tum_toplam := 10 - ((tek_toplam+cift_toplam) mod 10);
  17. If tum_toplam = 10 then tum_toplam := 0;
  18. Result := Format('%d', [tum_toplam]);
  19. end;
  20.  
  21. //------------------------------------------------------------------------------
  22.  
  23. function BarkodOlustur2():String;
  24. var
  25. s : string;
  26. i : integer;
  27. begin
  28. s:='';
  29. for i:=1 to 12 do
  30. begin
  31. s:=s+inttostr(random(10));
  32. end;
  33. Result := S + BarkodOlustur1(s);
  34. end;
  35.  
  36. //------------------------------------------------------------------------------
Time limit exceeded #stdin #stdout 5s 1704KB
stdin
Standard input is empty
stdout
Standard output is empty