WeixiangYan/CodeTransOcean huggingface dataset:
Task: CRC-32


C++: #include <algorithm>
#include <array>
#include <cstdint>
#include <numeric>


#include <iomanip>
#include <iostream>
#include <string>


std::array<std::uint_fast32_t, 256> generate_crc_lookup_table() noexcept
{
  auto const reversed_polynomial = std::uint_fast32_t{0xEDB88320uL};
  
  
  
  struct byte_checksum
  {
    std::uint_fast32_t operator()() noexcept
    {
      auto checksum = static_cast<std::uint_fast32_t>(n++);
      
      for (auto i = 0; i < 8; ++i)
        checksum = (checksum >> 1) ^ ((checksum & 0x1u) ? reversed_polynomial : 0);
      
      return checksum;
    }
    
    unsigned n = 0;
  };
  
  auto table = std::array<std::uint_fast32_t, 256>{};
  std::generate(table.begin(), table.end(), byte_checksum{});
  
  return table;
}



template <typename InputIterator>
std::uint_fast32_t crc(InputIterator first, InputIterator last)
{
  
  static auto const table = generate_crc_lookup_table();
  
  
  
  return std::uint_fast32_t{0xFFFFFFFFuL} &
    ~std::accumulate(first, last,
      ~std::uint_fast32_t{0} & std::uint_fast32_t{0xFFFFFFFFuL},
        [](std::uint_fast32_t checksum, std::uint_fast8_t value) 
          { return table[(checksum ^ value) & 0xFFu] ^ (checksum >> 8); });
}

int main()
{
  auto const s = std::string{"The quick brown fox jumps over the lazy dog"};
  
  std::cout << std::hex << std::setw(8) << std::setfill('0') << crc(s.begin(), s.end()) << '\n';
}








COBOL:       
       identification division.
       program-id. rosetta-crc32.

       environment division.
       configuration section.
       repository.
           function all intrinsic.

       data division.
       working-storage section.
       01 crc32-initial        usage binary-c-long.
       01 crc32-result         usage binary-c-long unsigned.
       01 crc32-input.
          05 value "The quick brown fox jumps over the lazy dog".
       01 crc32-hex            usage pointer.

       procedure division.
       crc32-main.

      
       call "crc32" using
           by value crc32-initial
           by reference crc32-input
           by value length(crc32-input)
           returning crc32-result
           on exception
               display "error: no crc32 zlib linkage" upon syserr
       end-call
       call "printf" using "checksum: %lx" & x"0a" by value crc32-result

      
       set crc32-hex up by crc32-result
       display 'crc32 of "' crc32-input '" is ' crc32-hex

       goback.
       end program rosetta-crc32.
Task: CRC-32





Java: import java.util.zip.* ;

public class CRCMaker {
   public static void main( String[ ] args ) {
      String toBeEncoded = new String( "The quick brown fox jumps over the lazy dog" ) ;
      CRC32 myCRC = new CRC32( ) ;
      myCRC.update( toBeEncoded.getBytes( ) ) ;
      System.out.println( "The CRC-32 value is : " + Long.toHexString( myCRC.getValue( ) ) + " !" ) ;
   }
}





COBOL:       
       identification division.
       program-id. rosetta-crc32.

       environment division.
       configuration section.
       repository.
           function all intrinsic.

       data division.
       working-storage section.
       01 crc32-initial        usage binary-c-long.
       01 crc32-result         usage binary-c-long unsigned.
       01 crc32-input.
          05 value "The quick brown fox jumps over the lazy dog".
       01 crc32-hex            usage pointer.

       procedure division.
       crc32-main.

      
       call "crc32" using
           by value crc32-initial
           by reference crc32-input
           by value length(crc32-input)
           returning crc32-result
           on exception
               display "error: no crc32 zlib linkage" upon syserr
       end-call
       call "printf" using "checksum: %lx" & x"0a" by value crc32-result

      
       set crc32-hex up by crc32-result
       display 'crc32 of "' crc32-input '" is ' crc32-hex

       goback.
       end program rosetta-crc32.
Task: CRC-32







Python: >>> s = 'The quick brown fox jumps over the lazy dog'
>>> import zlib
>>> hex(zlib.crc32(s))
'0x414fa339'

>>> import binascii
>>> hex(binascii.crc32(s))
'0x414fa339'



COBOL:       
       identification division.
       program-id. rosetta-crc32.

       environment division.
       configuration section.
       repository.
           function all intrinsic.

       data division.
       working-storage section.
       01 crc32-initial        usage binary-c-long.
       01 crc32-result         usage binary-c-long unsigned.
       01 crc32-input.
          05 value "The quick brown fox jumps over the lazy dog".
       01 crc32-hex            usage pointer.

       procedure division.
       crc32-main.

      
       call "crc32" using
           by value crc32-initial
           by reference crc32-input
           by value length(crc32-input)
           returning crc32-result
           on exception
               display "error: no crc32 zlib linkage" upon syserr
       end-call
       call "printf" using "checksum: %lx" & x"0a" by value crc32-result

      
       set crc32-hex up by crc32-result
       display 'crc32 of "' crc32-input '" is ' crc32-hex

       goback.
       end program rosetta-crc32.
Task: CRC-32








VB: dim crctbl(255)
const crcc =&hEDB88320

sub gencrctable
for i= 0 to 255
   k=i
   for j=1 to 8
    if k and 1 then 
      k=(k and &h7fffffff)\2 or (&h40000000 and ((k and &h80000000)<>0)) 
      k=k xor crcc
    else 
      k=(k and &h7fffffff)\2 or (&h40000000 and ((k and &h80000000)<>0))
   end if
   next 
   crctbl(i)=k
 next
end sub
 
 function crc32 (buf) 
  dim r,r1,i 
  r=&hffffffff 
  for i=1 to len(buf) 
      r1=(r and &h7fffffff)\&h100 or (&h800000 and (r and &h80000000)<>0)
    r=r1 xor crctbl((asc(mid(buf,i,1))xor r) and 255) 
  next 
  crc32=r xor &hffffffff
end function

  

gencrctable
wscript.stdout.writeline hex(crc32("The quick brown fox jumps over the lazy dog"))


COBOL:       
       identification division.
       program-id. rosetta-crc32.

       environment division.
       configuration section.
       repository.
           function all intrinsic.

       data division.
       working-storage section.
       01 crc32-initial        usage binary-c-long.
       01 crc32-result         usage binary-c-long unsigned.
       01 crc32-input.
          05 value "The quick brown fox jumps over the lazy dog".
       01 crc32-hex            usage pointer.

       procedure division.
       crc32-main.

      
       call "crc32" using
           by value crc32-initial
           by reference crc32-input
           by value length(crc32-input)
           returning crc32-result
           on exception
               display "error: no crc32 zlib linkage" upon syserr
       end-call
       call "printf" using "checksum: %lx" & x"0a" by value crc32-result

      
       set crc32-hex up by crc32-result
       display 'crc32 of "' crc32-input '" is ' crc32-hex

       goback.
       end program rosetta-crc32.
Task: CRC-32




Go: package main

import (
    "fmt"
    "hash/crc32"
)

func main() {
    s := []byte("The quick brown fox jumps over the lazy dog")
    result := crc32.ChecksumIEEE(s)
    fmt.Printf("%X\n", result)
}






COBOL:       
       identification division.
       program-id. rosetta-crc32.

       environment division.
       configuration section.
       repository.
           function all intrinsic.

       data division.
       working-storage section.
       01 crc32-initial        usage binary-c-long.
       01 crc32-result         usage binary-c-long unsigned.
       01 crc32-input.
          05 value "The quick brown fox jumps over the lazy dog".
       01 crc32-hex            usage pointer.

       procedure division.
       crc32-main.

      
       call "crc32" using
           by value crc32-initial
           by reference crc32-input
           by value length(crc32-input)
           returning crc32-result
           on exception
               display "error: no crc32 zlib linkage" upon syserr
       end-call
       call "printf" using "checksum: %lx" & x"0a" by value crc32-result

      
       set crc32-hex up by crc32-result
       display 'crc32 of "' crc32-input '" is ' crc32-hex

       goback.
       end program rosetta-crc32.
Task: CRC-32






PHP: printf("%x\n", crc32("The quick brown fox jumps over the lazy dog"));
Task: CRC-32






PHP: printf("%x\n", crc32("The quick brown fox jumps over the lazy dog"));






Ada: with Ada.Text_IO; use Ada.Text_IO;
with GNAT.CRC32; use GNAT.CRC32;
with Interfaces; use Interfaces;
procedure TestCRC is
   package IIO is new Ada.Text_IO.Modular_IO (Unsigned_32);
   crc : CRC32;
   num : Unsigned_32;
   str : String := "The quick brown fox jumps over the lazy dog";
begin
   Initialize (crc);
   Update (crc, str);
   num := Get_Value (crc);
   IIO.Put (num, Base => 16); New_Line;
end TestCRC;
Task: CRC-32






PHP: printf("%x\n", crc32("The quick brown fox jumps over the lazy dog"));




COBOL:       
       identification division.
       program-id. rosetta-crc32.

       environment division.
       configuration section.
       repository.
           function all intrinsic.

       data division.
       working-storage section.
       01 crc32-initial        usage binary-c-long.
       01 crc32-result         usage binary-c-long unsigned.
       01 crc32-input.
          05 value "The quick brown fox jumps over the lazy dog".
       01 crc32-hex            usage pointer.

       procedure division.
       crc32-main.

      
       call "crc32" using
           by value crc32-initial
           by reference crc32-input
           by value length(crc32-input)
           returning crc32-result
           on exception
               display "error: no crc32 zlib linkage" upon syserr
       end-call
       call "printf" using "checksum: %lx" & x"0a" by value crc32-result

      
       set crc32-hex up by crc32-result
       display 'crc32 of "' crc32-input '" is ' crc32-hex

       goback.
       end program rosetta-crc32.
Task: Determine if only one instance is running



C#: using System;
using System.Net;
using System.Net.Sockets;

class Program {        
    static void Main(string[] args) {        
        try {
            TcpListener server = new TcpListener(IPAddress.Any, 12345);
            server.Start();
        } 
       
        catch (SocketException e) {
            if (e.SocketErrorCode == SocketError.AddressAlreadyInUse) {
                Console.Error.WriteLine("Already running.");
            }
        }
    }
}









Ada: with Ada.Text_IO;

procedure Single_Instance is

   package IO renames Ada.Text_IO;
   Lock_File: IO.File_Type;
   Lock_File_Name: String := "single_instance.magic_lock";

begin
   begin
      IO.Open(File => Lock_File, Mode=> IO.In_File, Name => Lock_File_Name);
      IO.Close(Lock_File);
      IO.Put_Line("I can't 
   exception
      when IO.Name_Error =>
         IO.Put_Line("I can run!");
         IO.Create(File => Lock_File, Name => Lock_File_Name);
         for I in 1 .. 10 loop
            IO.Put(Integer'Image(I));
            delay 1.0; 
         end loop;
         IO.Delete(Lock_File);
         IO.New_Line;
         IO.Put_Line("I am done!");
   end;
exception
   when others => IO.Delete(Lock_File);
end Single_Instance;
Task: Determine if only one instance is running

C: #include <fcntl.h>	
#include <stdlib.h>	
#include <stdio.h>	
#include <string.h>	
#include <unistd.h>	


#define INSTANCE_LOCK "rosetta-code-lock"

void
fail(const char *message)
{
	perror(message);
	exit(1);
}


static char *ooi_path;

void
ooi_unlink(void)
{
	unlink(ooi_path);
}


void
only_one_instance(void)
{
	struct flock fl;
	size_t dirlen;
	int fd;
	char *dir;

	
	dir = getenv("HOME");
	if (dir == NULL || dir[0] != '/') {
		fputs("Bad home directory.\n", stderr);
		exit(1);
	}
	dirlen = strlen(dir);

	ooi_path = malloc(dirlen + sizeof("/" INSTANCE_LOCK));
	if (ooi_path == NULL)
		fail("malloc");
	memcpy(ooi_path, dir, dirlen);
	memcpy(ooi_path + dirlen, "/" INSTANCE_LOCK,
	    sizeof("/" INSTANCE_LOCK));  

	fd = open(ooi_path, O_RDWR | O_CREAT, 0600);
	if (fd < 0)
		fail(ooi_path);

	fl.l_start = 0;
	fl.l_len = 0;
	fl.l_type = F_WRLCK;
	fl.l_whence = SEEK_SET;
	if (fcntl(fd, F_SETLK, &fl) < 0) {
		fputs("Another instance of this program is running.\n",
		    stderr);
		exit(1);
	}

	
	atexit(ooi_unlink);
}


int
main()
{
	int i;

	only_one_instance();

	
	for(i = 10; i > 0; i--) {
		printf("%d...%s", i, i % 5 == 1 ? "\n" : " ");
		fflush(stdout);
		sleep(1);
	}
	puts("Fin!");
	return 0;
}











Ada: with Ada.Text_IO;

procedure Single_Instance is

   package IO renames Ada.Text_IO;
   Lock_File: IO.File_Type;
   Lock_File_Name: String := "single_instance.magic_lock";

begin
   begin
      IO.Open(File => Lock_File, Mode=> IO.In_File, Name => Lock_File_Name);
      IO.Close(Lock_File);
      IO.Put_Line("I can't 
   exception
      when IO.Name_Error =>
         IO.Put_Line("I can run!");
         IO.Create(File => Lock_File, Name => Lock_File_Name);
         for I in 1 .. 10 loop
            IO.Put(Integer'Image(I));
            delay 1.0; 
         end loop;
         IO.Delete(Lock_File);
         IO.New_Line;
         IO.Put_Line("I am done!");
   end;
exception
   when others => IO.Delete(Lock_File);
end Single_Instance;
Task: Determine if only one instance is running


C++: #include <afx.h>










Ada: with Ada.Text_IO;

procedure Single_Instance is

   package IO renames Ada.Text_IO;
   Lock_File: IO.File_Type;
   Lock_File_Name: String := "single_instance.magic_lock";

begin
   begin
      IO.Open(File => Lock_File, Mode=> IO.In_File, Name => Lock_File_Name);
      IO.Close(Lock_File);
      IO.Put_Line("I can't 
   exception
      when IO.Name_Error =>
         IO.Put_Line("I can run!");
         IO.Create(File => Lock_File, Name => Lock_File_Name);
         for I in 1 .. 10 loop
            IO.Put(Integer'Image(I));
            delay 1.0; 
         end loop;
         IO.Delete(Lock_File);
         IO.New_Line;
         IO.Put_Line("I am done!");
   end;
exception
   when others => IO.Delete(Lock_File);
end Single_Instance;
Task: Determine if only one instance is running




Go: package main

import (
    "fmt"
    "net"
    "time"
)

const lNet = "tcp"
const lAddr = ":12345"

func main() {
    if _, err := net.Listen(lNet, lAddr); err != nil {
        fmt.Println("an instance was already running")
        return
    }
    fmt.Println("single instance started")
    time.Sleep(10 * time.Second)
}








Ada: with Ada.Text_IO;

procedure Single_Instance is

   package IO renames Ada.Text_IO;
   Lock_File: IO.File_Type;
   Lock_File_Name: String := "single_instance.magic_lock";

begin
   begin
      IO.Open(File => Lock_File, Mode=> IO.In_File, Name => Lock_File_Name);
      IO.Close(Lock_File);
      IO.Put_Line("I can't 
   exception
      when IO.Name_Error =>
         IO.Put_Line("I can run!");
         IO.Create(File => Lock_File, Name => Lock_File_Name);
         for I in 1 .. 10 loop
            IO.Put(Integer'Image(I));
            delay 1.0; 
         end loop;
         IO.Delete(Lock_File);
         IO.New_Line;
         IO.Put_Line("I am done!");
   end;
exception
   when others => IO.Delete(Lock_File);
end Single_Instance;
Task: Determine if only one instance is running





Java: import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.UnknownHostException;
 
public class SingletonApp
{
    private static final int PORT = 65000;  
    private static ServerSocket s;

    
    static {
        try {
            s = new ServerSocket(PORT, 10, InetAddress.getLocalHost());
        } catch (UnknownHostException e) {
            
        } catch (IOException e) {
            
            System.out.print("Application is already running,");
            System.out.println(" so terminating this instance.");
            System.exit(0);
        }
    }

    public static void main(String[] args) {
        System.out.print("OK, only this instance is running");
        System.out.println(" but will terminate in 10 seconds.");
        try {
            Thread.sleep(10000);
            if (s != null && !s.isClosed()) s.close();
        } catch (Exception e) {
            System.err.println(e);
        }
    }
}







Ada: with Ada.Text_IO;

procedure Single_Instance is

   package IO renames Ada.Text_IO;
   Lock_File: IO.File_Type;
   Lock_File_Name: String := "single_instance.magic_lock";

begin
   begin
      IO.Open(File => Lock_File, Mode=> IO.In_File, Name => Lock_File_Name);
      IO.Close(Lock_File);
      IO.Put_Line("I can't 
   exception
      when IO.Name_Error =>
         IO.Put_Line("I can run!");
         IO.Create(File => Lock_File, Name => Lock_File_Name);
         for I in 1 .. 10 loop
            IO.Put(Integer'Image(I));
            delay 1.0; 
         end loop;
         IO.Delete(Lock_File);
         IO.New_Line;
         IO.Put_Line("I am done!");
   end;
exception
   when others => IO.Delete(Lock_File);
end Single_Instance;
Task: Determine if only one instance is running







Python: import __main__, os

def isOnlyInstance():
    
    
    return os.system("(( $(ps -ef | grep python | grep '[" +
                     __main__.__file__[0] + "]" + __main__.__file__[1:] +
                     "' | wc -l) > 1 ))") != 0





Ada: with Ada.Text_IO;

procedure Single_Instance is

   package IO renames Ada.Text_IO;
   Lock_File: IO.File_Type;
   Lock_File_Name: String := "single_instance.magic_lock";

begin
   begin
      IO.Open(File => Lock_File, Mode=> IO.In_File, Name => Lock_File_Name);
      IO.Close(Lock_File);
      IO.Put_Line("I can't 
   exception
      when IO.Name_Error =>
         IO.Put_Line("I can run!");
         IO.Create(File => Lock_File, Name => Lock_File_Name);
         for I in 1 .. 10 loop
            IO.Put(Integer'Image(I));
            delay 1.0; 
         end loop;
         IO.Delete(Lock_File);
         IO.New_Line;
         IO.Put_Line("I am done!");
   end;
exception
   when others => IO.Delete(Lock_File);
end Single_Instance;
Task: Determine if only one instance is running








VB: Dim onlyInstance as Boolean
onlyInstance = not App.PrevInstance




Ada: with Ada.Text_IO;

procedure Single_Instance is

   package IO renames Ada.Text_IO;
   Lock_File: IO.File_Type;
   Lock_File_Name: String := "single_instance.magic_lock";

begin
   begin
      IO.Open(File => Lock_File, Mode=> IO.In_File, Name => Lock_File_Name);
      IO.Close(Lock_File);
      IO.Put_Line("I can't 
   exception
      when IO.Name_Error =>
         IO.Put_Line("I can run!");
         IO.Create(File => Lock_File, Name => Lock_File_Name);
         for I in 1 .. 10 loop
            IO.Put(Integer'Image(I));
            delay 1.0; 
         end loop;
         IO.Delete(Lock_File);
         IO.New_Line;
         IO.Put_Line("I am done!");
   end;
exception
   when others => IO.Delete(Lock_File);
end Single_Instance;
Task: Determine if only one instance is running

C: #include <fcntl.h>	
#include <stdlib.h>	
#include <stdio.h>	
#include <string.h>	
#include <unistd.h>	


#define INSTANCE_LOCK "rosetta-code-lock"

void
fail(const char *message)
{
	perror(message);
	exit(1);
}


static char *ooi_path;

void
ooi_unlink(void)
{
	unlink(ooi_path);
}


void
only_one_instance(void)
{
	struct flock fl;
	size_t dirlen;
	int fd;
	char *dir;

	
	dir = getenv("HOME");
	if (dir == NULL || dir[0] != '/') {
		fputs("Bad home directory.\n", stderr);
		exit(1);
	}
	dirlen = strlen(dir);

	ooi_path = malloc(dirlen + sizeof("/" INSTANCE_LOCK));
	if (ooi_path == NULL)
		fail("malloc");
	memcpy(ooi_path, dir, dirlen);
	memcpy(ooi_path + dirlen, "/" INSTANCE_LOCK,
	    sizeof("/" INSTANCE_LOCK));  

	fd = open(ooi_path, O_RDWR | O_CREAT, 0600);
	if (fd < 0)
		fail(ooi_path);

	fl.l_start = 0;
	fl.l_len = 0;
	fl.l_type = F_WRLCK;
	fl.l_whence = SEEK_SET;
	if (fcntl(fd, F_SETLK, &fl) < 0) {
		fputs("Another instance of this program is running.\n",
		    stderr);
		exit(1);
	}

	
	atexit(ooi_unlink);
}


int
main()
{
	int i;

	only_one_instance();

	
	for(i = 10; i > 0; i--) {
		printf("%d...%s", i, i % 5 == 1 ? "\n" : " ");
		fflush(stdout);
		sleep(1);
	}
	puts("Fin!");
	return 0;
}
Task: Determine if only one instance is running



C#: using System;
using System.Net;
using System.Net.Sockets;

class Program {        
    static void Main(string[] args) {        
        try {
            TcpListener server = new TcpListener(IPAddress.Any, 12345);
            server.Start();
        } 
       
        catch (SocketException e) {
            if (e.SocketErrorCode == SocketError.AddressAlreadyInUse) {
                Console.Error.WriteLine("Already running.");
            }
        }
    }
}
Task: Determine if only one instance is running


C++: #include <afx.h>
Task: Determine if only one instance is running





Java: import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.UnknownHostException;
 
public class SingletonApp
{
    private static final int PORT = 65000;  
    private static ServerSocket s;

    
    static {
        try {
            s = new ServerSocket(PORT, 10, InetAddress.getLocalHost());
        } catch (UnknownHostException e) {
            
        } catch (IOException e) {
            
            System.out.print("Application is already running,");
            System.out.println(" so terminating this instance.");
            System.exit(0);
        }
    }

    public static void main(String[] args) {
        System.out.print("OK, only this instance is running");
        System.out.println(" but will terminate in 10 seconds.");
        try {
            Thread.sleep(10000);
            if (s != null && !s.isClosed()) s.close();
        } catch (Exception e) {
            System.err.println(e);
        }
    }
}
Task: Determine if only one instance is running







Python: import __main__, os

def isOnlyInstance():
    
    
    return os.system("(( $(ps -ef | grep python | grep '[" +
                     __main__.__file__[0] + "]" + __main__.__file__[1:] +
                     "' | wc -l) > 1 ))") != 0
Task: Determine if only one instance is running








VB: Dim onlyInstance as Boolean
onlyInstance = not App.PrevInstance
Task: Determine if only one instance is running




Go: package main

import (
    "fmt"
    "net"
    "time"
)

const lNet = "tcp"
const lAddr = ":12345"

func main() {
    if _, err := net.Listen(lNet, lAddr); err != nil {
        fmt.Println("an instance was already running")
        return
    }
    fmt.Println("single instance started")
    time.Sleep(10 * time.Second)
}
Task: Van der Corput sequence

C: #include <stdio.h>

void vc(int n, int base, int *num, int *denom)
{
        int p = 0, q = 1;

        while (n) {
                p = p * base + (n % base);
                q *= base;
                n /= base;
        }

        *num = p;  
        *denom = q;

        while (p) { n = p; p = q % p; q = n; }
        *num /= q;
        *denom /= q;
}

int main()
{
        int d, n, i, b;
        for (b = 2; b < 6; b++) {
                printf("base %d:", b);
                for (i = 0; i < 10; i++) {
                        vc(i, b, &n, &d);
                        if (n) printf("  %d/%d", n, d);
                        else   printf("  0");
                }
                printf("\n");
        }

        return 0;
}











Ada: with Ada.Text_IO;

procedure Main is
   package Float_IO is new Ada.Text_IO.Float_IO (Float);
   function Van_Der_Corput (N : Natural; Base : Positive := 2) return Float is
      Value    : Natural  := N;
      Result   : Float    := 0.0;
      Exponent : Positive := 1;
   begin
      while Value > 0 loop
         Result   := Result +
                     Float (Value mod Base) / Float (Base ** Exponent);
         Value    := Value / Base;
         Exponent := Exponent + 1;
      end loop;
      return Result;
   end Van_Der_Corput;
begin
   for Base in 2 .. 5 loop
      Ada.Text_IO.Put ("Base" & Integer'Image (Base) & ":");
      for N in 1 .. 10 loop
         Ada.Text_IO.Put (' ');
         Float_IO.Put (Item => Van_Der_Corput (N, Base), Exp => 0);
      end loop;
      Ada.Text_IO.New_Line;
   end loop;
end Main;