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. function BarkodOlustur2():String;
  23. var
  24. s : string;
  25. i : integer;
  26. begin
  27. s:='';
  28. for i:=1 to 12 do
  29. begin
  30. s:=s+inttostr(random(10));
  31. end;
  32. Result := S + BarkodOlustur1(s);
  33. end;
  34.  
  35.  
  36. procedure TForm1.BitBtn7Click(Sender: TObject);
  37. begin
  38. Memo1.Text:=BarkodOlustur2;
  39. end;
  40. end.
  41.  
Runtime error #stdin #stdout 0.02s 5312KB
stdin
Standard input is empty
stdout
Standard output is empty