fork(1) download
  1. const
  2. fi = '';//MULONE.INP';
  3. fo = '';//MULONE.OUT';
  4. maxn = 10000000;
  5. var
  6. n,test,t : longint;
  7. kq : array[1..maxn] of longint;
  8.  
  9. procedure sol;
  10. var
  11. i,nho,tong : longint;
  12. count : longint;
  13. begin
  14. tong:=0; nho:=0; count:=0;
  15. for i:=1 to n do
  16. begin
  17. tong:=(i+nho) mod 10;
  18. nho:=(i+nho) div 10;
  19. inc(count);
  20. kq[count]:=tong;
  21. end;
  22. for i:=n-1 downto 1 do
  23. begin
  24. tong:=(i+nho) mod 10;
  25. nho:=(i+nho) div 10;
  26. inc(count);
  27. kq[count]:=tong;
  28. end;
  29. for i:=count downto 1 do write(kq[i]);
  30. writeln;
  31. end;
  32.  
  33. BEGIN
  34. assign(input,fi); reset(input);
  35. assign(output,fo); rewrite(output);
  36. readln(T);
  37. for test:=1 to T do
  38. begin
  39. readln(N);
  40. sol;
  41. end;
  42. close(input);
  43. close(output);
  44. END.
Success #stdin #stdout 0s 4376KB
stdin
Standard input is empty
stdout
Standard output is empty