kazuyamaa/multi-language-messages-01 huggingface dataset:
Task: Binary digits
C: #define _CRT_SECURE_NO_WARNINGS    
#define _CRT_NONSTDC_NO_DEPRECATE   

#include <stdio.h>
#include <stdlib.h>


char* bin2str(unsigned value, char* buffer)
{
    
    
    
    
    
    
    

    const unsigned N_DIGITS = sizeof(unsigned) * 8;
    unsigned mask = 1 << (N_DIGITS - 1);
    char* ptr = buffer;

    for (int i = 0; i < N_DIGITS; i++)
    {
        *ptr++ = '0' + !!(value & mask);
        mask >>= 1;
    }
    *ptr = '\0';

    
    
    for (ptr = buffer; *ptr == '0'; ptr++)
        ;

    return ptr;
}


char* bin2strNaive(unsigned value, char* buffer)
{
    

    unsigned n, m, p;

    n = 0;
    p = 1;  
    while (p <= value / 2)
    {
        n = n + 1;
        p = p * 2;
    }

    m = 0;
    while (n > 0)
    {
        buffer[m] = '0' + value / p;
        value = value % p;
        m = m + 1;
        n = n - 1;
        p = p / 2;
    }

    buffer[m + 1] = '\0';
    return buffer;
}


int main(int argc, char* argv[])
{
    const unsigned NUMBERS[] = { 5, 50, 9000 };

    const int RADIX = 2;
    char buffer[(sizeof(unsigned)*8 + 1)];

    
    
    
    
    
    
    
    for (int i = 0; i < sizeof(NUMBERS) / sizeof(unsigned); i++)
    {
        unsigned value = NUMBERS[i];
        itoa(value, buffer, RADIX);
        printf("itoa:          %u decimal = %s binary\n", value, buffer);
    }

    
    
    
    for (int i = 0; i < sizeof(NUMBERS) / sizeof(unsigned); i++)
    {
        unsigned value = NUMBERS[i];
        printf("bin2str:       %u decimal = %s binary\n", value, bin2str(value, buffer));
    }

    
    
    for (int i = 0; i < sizeof(NUMBERS) / sizeof(unsigned); i++)
    {
        unsigned value = NUMBERS[i];
        printf("bin2strNaive:  %u decimal = %s binary\n", value, bin2strNaive(value, buffer));
    }

    return EXIT_SUCCESS;
}

Java: module BinaryDigits
    {
    @Inject Console console;
    void run()
        {
        Int[] tests = [0, 1, 5, 50, 9000];

        Int longestInt = tests.map(n -> n.estimateStringLength()).reduce(0, (max, len) -> max.maxOf(len));
        Int longestBin = tests.map(n -> (64-n.leadingZeroCount).maxOf(1)).reduce(0, (max, len) -> max.maxOf(len));

        function String(Int) num = n ->
            {
            Int indent = longestInt - n.estimateStringLength();
            return $"{' ' * indent}{n}";
            };

        function String(Int) bin = n ->
            {
            Int index  = n.leadingZeroCount.minOf(63);
            Int indent = index - (64 - longestBin);
            val bits   = n.toBitArray()[index ..< 64];
            return $"{' ' * indent}{bits.toString().substring(2)}";
            };

        for (Int test : tests)
            {
            console.print($"The decimal value {num(test)} should produce an output of {bin(test)}");
            }
        }
    }
Task: Binary digits
C: #define _CRT_SECURE_NO_WARNINGS    
#define _CRT_NONSTDC_NO_DEPRECATE   

#include <stdio.h>
#include <stdlib.h>


char* bin2str(unsigned value, char* buffer)
{
    
    
    
    
    
    
    

    const unsigned N_DIGITS = sizeof(unsigned) * 8;
    unsigned mask = 1 << (N_DIGITS - 1);
    char* ptr = buffer;

    for (int i = 0; i < N_DIGITS; i++)
    {
        *ptr++ = '0' + !!(value & mask);
        mask >>= 1;
    }
    *ptr = '\0';

    
    
    for (ptr = buffer; *ptr == '0'; ptr++)
        ;

    return ptr;
}


char* bin2strNaive(unsigned value, char* buffer)
{
    

    unsigned n, m, p;

    n = 0;
    p = 1;  
    while (p <= value / 2)
    {
        n = n + 1;
        p = p * 2;
    }

    m = 0;
    while (n > 0)
    {
        buffer[m] = '0' + value / p;
        value = value % p;
        m = m + 1;
        n = n - 1;
        p = p / 2;
    }

    buffer[m + 1] = '\0';
    return buffer;
}


int main(int argc, char* argv[])
{
    const unsigned NUMBERS[] = { 5, 50, 9000 };

    const int RADIX = 2;
    char buffer[(sizeof(unsigned)*8 + 1)];

    
    
    
    
    
    
    
    for (int i = 0; i < sizeof(NUMBERS) / sizeof(unsigned); i++)
    {
        unsigned value = NUMBERS[i];
        itoa(value, buffer, RADIX);
        printf("itoa:          %u decimal = %s binary\n", value, buffer);
    }

    
    
    
    for (int i = 0; i < sizeof(NUMBERS) / sizeof(unsigned); i++)
    {
        unsigned value = NUMBERS[i];
        printf("bin2str:       %u decimal = %s binary\n", value, bin2str(value, buffer));
    }

    
    
    for (int i = 0; i < sizeof(NUMBERS) / sizeof(unsigned); i++)
    {
        unsigned value = NUMBERS[i];
        printf("bin2strNaive:  %u decimal = %s binary\n", value, bin2strNaive(value, buffer));
    }

    return EXIT_SUCCESS;
}

Python: >>> for i in range(16): print('{0:b}'.format(i))

0
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
Task: Binary digits
C: #define _CRT_SECURE_NO_WARNINGS    
#define _CRT_NONSTDC_NO_DEPRECATE   

#include <stdio.h>
#include <stdlib.h>


char* bin2str(unsigned value, char* buffer)
{
    
    
    
    
    
    
    

    const unsigned N_DIGITS = sizeof(unsigned) * 8;
    unsigned mask = 1 << (N_DIGITS - 1);
    char* ptr = buffer;

    for (int i = 0; i < N_DIGITS; i++)
    {
        *ptr++ = '0' + !!(value & mask);
        mask >>= 1;
    }
    *ptr = '\0';

    
    
    for (ptr = buffer; *ptr == '0'; ptr++)
        ;

    return ptr;
}


char* bin2strNaive(unsigned value, char* buffer)
{
    

    unsigned n, m, p;

    n = 0;
    p = 1;  
    while (p <= value / 2)
    {
        n = n + 1;
        p = p * 2;
    }

    m = 0;
    while (n > 0)
    {
        buffer[m] = '0' + value / p;
        value = value % p;
        m = m + 1;
        n = n - 1;
        p = p / 2;
    }

    buffer[m + 1] = '\0';
    return buffer;
}


int main(int argc, char* argv[])
{
    const unsigned NUMBERS[] = { 5, 50, 9000 };

    const int RADIX = 2;
    char buffer[(sizeof(unsigned)*8 + 1)];

    
    
    
    
    
    
    
    for (int i = 0; i < sizeof(NUMBERS) / sizeof(unsigned); i++)
    {
        unsigned value = NUMBERS[i];
        itoa(value, buffer, RADIX);
        printf("itoa:          %u decimal = %s binary\n", value, buffer);
    }

    
    
    
    for (int i = 0; i < sizeof(NUMBERS) / sizeof(unsigned); i++)
    {
        unsigned value = NUMBERS[i];
        printf("bin2str:       %u decimal = %s binary\n", value, bin2str(value, buffer));
    }

    
    
    for (int i = 0; i < sizeof(NUMBERS) / sizeof(unsigned); i++)
    {
        unsigned value = NUMBERS[i];
        printf("bin2strNaive:  %u decimal = %s binary\n", value, bin2strNaive(value, buffer));
    }

    return EXIT_SUCCESS;
}

VB: 
Print "bin 5 = ", bin$(5)
Print "bin 50 = ",bin$(50)
Print "bin 9000 = ",bin$(9000)
sleep 10
Task: Binary digits
C++: #include <bitset>
#include <iostream>
#include <limits>
#include <string>
 
void print_bin(unsigned int n) {
  std::string str = "0";

  if (n > 0) {
    str = std::bitset<std::numeric_limits<unsigned int>::digits>(n).to_string();
    str = str.substr(str.find('1')); 
  } 
  
  std::cout << str << '\n';
}

int main() {
  print_bin(0);
  print_bin(5);
  print_bin(50);
  print_bin(9000);
}

Python: >>> for i in range(16): print('{0:b}'.format(i))

0
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
Task: Binary digits
Java: module BinaryDigits
    {
    @Inject Console console;
    void run()
        {
        Int[] tests = [0, 1, 5, 50, 9000];

        Int longestInt = tests.map(n -> n.estimateStringLength()).reduce(0, (max, len) -> max.maxOf(len));
        Int longestBin = tests.map(n -> (64-n.leadingZeroCount).maxOf(1)).reduce(0, (max, len) -> max.maxOf(len));

        function String(Int) num = n ->
            {
            Int indent = longestInt - n.estimateStringLength();
            return $"{' ' * indent}{n}";
            };

        function String(Int) bin = n ->
            {
            Int index  = n.leadingZeroCount.minOf(63);
            Int indent = index - (64 - longestBin);
            val bits   = n.toBitArray()[index ..< 64];
            return $"{' ' * indent}{bits.toString().substring(2)}";
            };

        for (Int test : tests)
            {
            console.print($"The decimal value {num(test)} should produce an output of {bin(test)}");
            }
        }
    }

Python: >>> for i in range(16): print('{0:b}'.format(i))

0
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
Task: Binary digits
Java: module BinaryDigits
    {
    @Inject Console console;
    void run()
        {
        Int[] tests = [0, 1, 5, 50, 9000];

        Int longestInt = tests.map(n -> n.estimateStringLength()).reduce(0, (max, len) -> max.maxOf(len));
        Int longestBin = tests.map(n -> (64-n.leadingZeroCount).maxOf(1)).reduce(0, (max, len) -> max.maxOf(len));

        function String(Int) num = n ->
            {
            Int indent = longestInt - n.estimateStringLength();
            return $"{' ' * indent}{n}";
            };

        function String(Int) bin = n ->
            {
            Int index  = n.leadingZeroCount.minOf(63);
            Int indent = index - (64 - longestBin);
            val bits   = n.toBitArray()[index ..< 64];
            return $"{' ' * indent}{bits.toString().substring(2)}";
            };

        for (Int test : tests)
            {
            console.print($"The decimal value {num(test)} should produce an output of {bin(test)}");
            }
        }
    }

VB: 
Print "bin 5 = ", bin$(5)
Print "bin 50 = ",bin$(50)
Print "bin 9000 = ",bin$(9000)
sleep 10
Task: Binary digits
Python: >>> for i in range(16): print('{0:b}'.format(i))

0
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111

VB: 
Print "bin 5 = ", bin$(5)
Print "bin 50 = ",bin$(50)
Print "bin 9000 = ",bin$(9000)
sleep 10
Task: Binary digits
C++: #include <bitset>
#include <iostream>
#include <limits>
#include <string>
 
void print_bin(unsigned int n) {
  std::string str = "0";

  if (n > 0) {
    str = std::bitset<std::numeric_limits<unsigned int>::digits>(n).to_string();
    str = str.substr(str.find('1')); 
  } 
  
  std::cout << str << '\n';
}

int main() {
  print_bin(0);
  print_bin(5);
  print_bin(50);
  print_bin(9000);
}

Java: module BinaryDigits
    {
    @Inject Console console;
    void run()
        {
        Int[] tests = [0, 1, 5, 50, 9000];

        Int longestInt = tests.map(n -> n.estimateStringLength()).reduce(0, (max, len) -> max.maxOf(len));
        Int longestBin = tests.map(n -> (64-n.leadingZeroCount).maxOf(1)).reduce(0, (max, len) -> max.maxOf(len));

        function String(Int) num = n ->
            {
            Int indent = longestInt - n.estimateStringLength();
            return $"{' ' * indent}{n}";
            };

        function String(Int) bin = n ->
            {
            Int index  = n.leadingZeroCount.minOf(63);
            Int indent = index - (64 - longestBin);
            val bits   = n.toBitArray()[index ..< 64];
            return $"{' ' * indent}{bits.toString().substring(2)}";
            };

        for (Int test : tests)
            {
            console.print($"The decimal value {num(test)} should produce an output of {bin(test)}");
            }
        }
    }
Task: Binary digits
C++: #include <bitset>
#include <iostream>
#include <limits>
#include <string>
 
void print_bin(unsigned int n) {
  std::string str = "0";

  if (n > 0) {
    str = std::bitset<std::numeric_limits<unsigned int>::digits>(n).to_string();
    str = str.substr(str.find('1')); 
  } 
  
  std::cout << str << '\n';
}

int main() {
  print_bin(0);
  print_bin(5);
  print_bin(50);
  print_bin(9000);
}

VB: 
Print "bin 5 = ", bin$(5)
Print "bin 50 = ",bin$(50)
Print "bin 9000 = ",bin$(9000)
sleep 10
Task: Singly-linked list_Element insertion
C: void insert_append (struct link *anchor, struct link *newlink) {
  newlink->next = anchor->next;
  anchor->next = newlink;
}

C#: static void InsertAfter<T>(LinkedListNode<T> prev, T value)
{
    prev.Next = new Link() { Value = value, Next = prev.Next };
}
Task: Singly-linked list_Element insertion
C: void insert_append (struct link *anchor, struct link *newlink) {
  newlink->next = anchor->next;
  anchor->next = newlink;
}

C++: template<typename T> void insert_after(link<T>* list_node, link<T>* new_node)
{
  new_node->next = list_node->next;
  list_node->next = new_node;
};
Task: Singly-linked list_Element insertion
C: void insert_append (struct link *anchor, struct link *newlink) {
  newlink->next = anchor->next;
  anchor->next = newlink;
}

Go: package main

import "fmt"

type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) insert(data interface{}) {
    if e == nil {
        panic("attept to modify nil")
    }
    e.Next = &Ele{data, e.Next}
}

func (e *Ele) printList() {
    if e == nil {
        fmt.Println(nil)
        return
    }
    fmt.Printf("(%v", e.Data)
    for {
        e = e.Next
        if e == nil {
            fmt.Println(")")
            return
        }
        fmt.Print(" ", e.Data)
    }
}

func main() {
    h := &Ele{"A", &Ele{"B", nil}}
    h.printList()
    h.insert("C")
    h.printList()
}
Task: Singly-linked list_Element insertion
C: void insert_append (struct link *anchor, struct link *newlink) {
  newlink->next = anchor->next;
  anchor->next = newlink;
}

Python: def chain_insert(lst, at, item):
    while lst is not None:
        if lst[0] == at:
            lst[1] = [item, lst[1]]
            return
        else:
            lst = lst[1]
    raise ValueError(str(at) + " not found")

chain = ['A', ['B', None]]
chain_insert(chain, 'A', 'C')
print chain
Task: Singly-linked list_Element insertion
C#: static void InsertAfter<T>(LinkedListNode<T> prev, T value)
{
    prev.Next = new Link() { Value = value, Next = prev.Next };
}

C++: template<typename T> void insert_after(link<T>* list_node, link<T>* new_node)
{
  new_node->next = list_node->next;
  list_node->next = new_node;
};
Task: Singly-linked list_Element insertion
C++: template<typename T> void insert_after(link<T>* list_node, link<T>* new_node)
{
  new_node->next = list_node->next;
  list_node->next = new_node;
};

Python: def chain_insert(lst, at, item):
    while lst is not None:
        if lst[0] == at:
            lst[1] = [item, lst[1]]
            return
        else:
            lst = lst[1]
    raise ValueError(str(at) + " not found")

chain = ['A', ['B', None]]
chain_insert(chain, 'A', 'C')
print chain
Task: Singly-linked list_Element insertion
C#: static void InsertAfter<T>(LinkedListNode<T> prev, T value)
{
    prev.Next = new Link() { Value = value, Next = prev.Next };
}

Go: package main

import "fmt"

type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) insert(data interface{}) {
    if e == nil {
        panic("attept to modify nil")
    }
    e.Next = &Ele{data, e.Next}
}

func (e *Ele) printList() {
    if e == nil {
        fmt.Println(nil)
        return
    }
    fmt.Printf("(%v", e.Data)
    for {
        e = e.Next
        if e == nil {
            fmt.Println(")")
            return
        }
        fmt.Print(" ", e.Data)
    }
}

func main() {
    h := &Ele{"A", &Ele{"B", nil}}
    h.printList()
    h.insert("C")
    h.printList()
}
Task: Singly-linked list_Element insertion
C#: static void InsertAfter<T>(LinkedListNode<T> prev, T value)
{
    prev.Next = new Link() { Value = value, Next = prev.Next };
}

Python: def chain_insert(lst, at, item):
    while lst is not None:
        if lst[0] == at:
            lst[1] = [item, lst[1]]
            return
        else:
            lst = lst[1]
    raise ValueError(str(at) + " not found")

chain = ['A', ['B', None]]
chain_insert(chain, 'A', 'C')
print chain
Task: Singly-linked list_Element insertion
Java: void insertNode(Node<T> anchor_node, Node<T> new_node)
{
    new_node.next = anchor_node.next;
    anchor_node.next = new_node;
}

Python: def chain_insert(lst, at, item):
    while lst is not None:
        if lst[0] == at:
            lst[1] = [item, lst[1]]
            return
        else:
            lst = lst[1]
    raise ValueError(str(at) + " not found")

chain = ['A', ['B', None]]
chain_insert(chain, 'A', 'C')
print chain
Task: Singly-linked list_Element insertion
Go: package main

import "fmt"

type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) insert(data interface{}) {
    if e == nil {
        panic("attept to modify nil")
    }
    e.Next = &Ele{data, e.Next}
}

func (e *Ele) printList() {
    if e == nil {
        fmt.Println(nil)
        return
    }
    fmt.Printf("(%v", e.Data)
    for {
        e = e.Next
        if e == nil {
            fmt.Println(")")
            return
        }
        fmt.Print(" ", e.Data)
    }
}

func main() {
    h := &Ele{"A", &Ele{"B", nil}}
    h.printList()
    h.insert("C")
    h.printList()
}

Python: def chain_insert(lst, at, item):
    while lst is not None:
        if lst[0] == at:
            lst[1] = [item, lst[1]]
            return
        else:
            lst = lst[1]
    raise ValueError(str(at) + " not found")

chain = ['A', ['B', None]]
chain_insert(chain, 'A', 'C')
print chain
Task: Singly-linked list_Element insertion
C: void insert_append (struct link *anchor, struct link *newlink) {
  newlink->next = anchor->next;
  anchor->next = newlink;
}

Java: void insertNode(Node<T> anchor_node, Node<T> new_node)
{
    new_node.next = anchor_node.next;
    anchor_node.next = new_node;
}
Task: Singly-linked list_Element insertion
C++: template<typename T> void insert_after(link<T>* list_node, link<T>* new_node)
{
  new_node->next = list_node->next;
  list_node->next = new_node;
};

Go: package main

import "fmt"

type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) insert(data interface{}) {
    if e == nil {
        panic("attept to modify nil")
    }
    e.Next = &Ele{data, e.Next}
}

func (e *Ele) printList() {
    if e == nil {
        fmt.Println(nil)
        return
    }
    fmt.Printf("(%v", e.Data)
    for {
        e = e.Next
        if e == nil {
            fmt.Println(")")
            return
        }
        fmt.Print(" ", e.Data)
    }
}

func main() {
    h := &Ele{"A", &Ele{"B", nil}}
    h.printList()
    h.insert("C")
    h.printList()
}
Task: Singly-linked list_Element insertion
Go: package main

import "fmt"

type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) insert(data interface{}) {
    if e == nil {
        panic("attept to modify nil")
    }
    e.Next = &Ele{data, e.Next}
}

func (e *Ele) printList() {
    if e == nil {
        fmt.Println(nil)
        return
    }
    fmt.Printf("(%v", e.Data)
    for {
        e = e.Next
        if e == nil {
            fmt.Println(")")
            return
        }
        fmt.Print(" ", e.Data)
    }
}

func main() {
    h := &Ele{"A", &Ele{"B", nil}}
    h.printList()
    h.insert("C")
    h.printList()
}

Java: void insertNode(Node<T> anchor_node, Node<T> new_node)
{
    new_node.next = anchor_node.next;
    anchor_node.next = new_node;
}
Task: Singly-linked list_Element insertion
C++: template<typename T> void insert_after(link<T>* list_node, link<T>* new_node)
{
  new_node->next = list_node->next;
  list_node->next = new_node;
};

Java: void insertNode(Node<T> anchor_node, Node<T> new_node)
{
    new_node.next = anchor_node.next;
    anchor_node.next = new_node;
}
Task: Singly-linked list_Element insertion
C#: static void InsertAfter<T>(LinkedListNode<T> prev, T value)
{
    prev.Next = new Link() { Value = value, Next = prev.Next };
}

Java: void insertNode(Node<T> anchor_node, Node<T> new_node)
{
    new_node.next = anchor_node.next;
    anchor_node.next = new_node;
}
Task: Words containing _the_ substring
C: #include <stdio.h>
#include <string.h>

int main() {
    char word[128];
    FILE *f = fopen("unixdict.txt","r");
    if (!f) {
        fprintf(stderr, "Cannot open unixdict.txt\n");
        return -1;
    }
    while (!feof(f)) {
        fgets(word, sizeof(word), f);
        
        
        if (strlen(word) > 12 && strstr(word,"the"))
            printf("%s",word);
    }
    fclose(f);
    return 0;
}

C#: #include <iostream>
#include <fstream>

int main() {
    std::string word;
    std::ifstream file("unixdict.txt");
 
    if (!file) {
        std::cerr << "Cannot open unixdict.txt" << std::endl;
        return -1;
    }
    while (file >> word) {
        if (word.length() > 11 && word.find("the") != std::string::npos)
            std::cout << word << std::endl;
    }
    return 0;
}
Task: Words containing _the_ substring
C: #include <stdio.h>
#include <string.h>

int main() {
    char word[128];
    FILE *f = fopen("unixdict.txt","r");
    if (!f) {
        fprintf(stderr, "Cannot open unixdict.txt\n");
        return -1;
    }
    while (!feof(f)) {
        fgets(word, sizeof(word), f);
        
        
        if (strlen(word) > 12 && strstr(word,"the"))
            printf("%s",word);
    }
    fclose(f);
    return 0;
}

Python: import urllib.request as request

with request.urlopen("http://wiki.puzzlers.org/pub/wordlists/unixdict.txt") as f:
    a = f.read().decode("ASCII").split()

for s in a:
    if len(s) > 11 and "the" in s:
        print(s)
Task: Words containing _the_ substring
C: #include <stdio.h>
#include <string.h>

int main() {
    char word[128];
    FILE *f = fopen("unixdict.txt","r");
    if (!f) {
        fprintf(stderr, "Cannot open unixdict.txt\n");
        return -1;
    }
    while (!feof(f)) {
        fgets(word, sizeof(word), f);
        
        
        if (strlen(word) > 12 && strstr(word,"the"))
            printf("%s",word);
    }
    fclose(f);
    return 0;
}

VB: Sub Main_Contain()
Dim ListeWords() As String, Book As String, i As Long, out() As String, count As Integer
    Book = Read_File("C:\Users\" & Environ("Username") & "\Desktop\unixdict.txt")
    ListeWords = Split(Book, vbNewLine)
    For i = LBound(ListeWords) To UBound(ListeWords)
        If Len(ListeWords(i)) > 11 Then
            If InStr(ListeWords(i), "the") > 0 Then
                ReDim Preserve out(count)
                out(count) = ListeWords(i)
                count = count + 1
            End If
        End If
    Next
    Debug.Print "Found : " & count & " words : " & Join(out, ", ")
End Sub
Private Function Read_File(Fic As String) As String
Dim Nb As Integer
    Nb = FreeFile
    Open Fic For Input As #Nb
        Read_File = Input(LOF(Nb), #Nb)
    Close #Nb
End Function
Task: Words containing _the_ substring
C++: #include <iostream>
#include <fstream>

int main() {
    std::string word;
    std::ifstream file("unixdict.txt");
 
    if (!file) {
        std::cerr << "Cannot open unixdict.txt" << std::endl;
        return -1;
    }
    while (file >> word) {
        if (word.length() > 11 && word.find("the") != std::string::npos)
            std::cout << word << std::endl;
    }
    return 0;
}

Go: package main

import (
    "bytes"
    "fmt"
    "io/ioutil"
    "log"
    "strings"
    "unicode/utf8"
)

func main() {
    wordList := "unixdict.txt"
    b, err := ioutil.ReadFile(wordList)
    if err != nil {
        log.Fatal("Error reading file")
    }
    bwords := bytes.Fields(b)
    var words []string
    for _, bword := range bwords {
        s := string(bword)
        if utf8.RuneCountInString(s) > 11 {
            words = append(words, s)
        }
    }
    count := 0
    fmt.Println("Words containing 'the' having a length > 11 in", wordList, "\b:")
    for _, word := range words {
        if strings.Contains(word, "the") {
            count++
            fmt.Printf("%2d: %s\n", count, word)
        }
    }
}