WeixiangYan/CodeTransOcean huggingface dataset:
Task: Chinese remainder theorem




Go: package main

import (
    "fmt"
    "math/big"
)

var one = big.NewInt(1)

func crt(a, n []*big.Int) (*big.Int, error) {
    p := new(big.Int).Set(n[0])
    for _, n1 := range n[1:] {
        p.Mul(p, n1)
    }
    var x, q, s, z big.Int
    for i, n1 := range n {
        q.Div(p, n1)
        z.GCD(nil, &s, n1, &q)
        if z.Cmp(one) != 0 {
            return nil, fmt.Errorf("%d not coprime", n1)
        }
        x.Add(&x, s.Mul(a[i], s.Mul(&s, &q)))
    }
    return x.Mod(&x, p), nil
}

func main() {
    n := []*big.Int{
        big.NewInt(3),
        big.NewInt(5),
        big.NewInt(7),
    }
    a := []*big.Int{
        big.NewInt(2),
        big.NewInt(3),
        big.NewInt(2),
    }
    fmt.Println(crt(a, n))
}
Task: Rosetta Code_Rank languages by popularity

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

const char * lang_url = "http:
		"list=categorymembers&cmtitle=Category:Programming_Languages&"
		"cmlimit=500&format=json";
const char * cat_url = "http:

#define BLOCK 1024
char *get_page(const char *url)
{
	char cmd[1024];
	char *ptr, *buf;
	int bytes_read = 1, len = 0;
	sprintf(cmd, "wget -q \"%s\" -O -", url);
	FILE *fp = popen(cmd, "r");
	if (!fp) return 0;
	for (ptr = buf = 0; bytes_read > 0; ) {
		buf = realloc(buf, 1 + (len += BLOCK));
		if (!ptr) ptr = buf;
		bytes_read = fread(ptr, 1, BLOCK, fp);
		if (bytes_read <= 0) break;
		ptr += bytes_read;
	}
	*++ptr = '\0';
	return buf;
}

char ** get_langs(char *buf, int *l)
{
	char **arr = 0;
	for (*l = 0; (buf = strstr(buf, "Category:")) && (buf += 9); ++*l)
		for (	(*l)[arr = realloc(arr, sizeof(char*)*(1 + *l))] = buf;
			*buf != '"' || (*buf++ = 0);
			buf++);

	return arr;
}

typedef struct { const char *name; int count; } cnt_t;
cnt_t * get_cats(char *buf, char ** langs, int len, int *ret_len)
{
	char str[1024], *found;
	cnt_t *list = 0;
	int i, llen = 0;
	for (i = 0; i < len; i++) {
		sprintf(str, "/wiki/Category:%s", langs[i]);
		if (!(found = strstr(buf, str))) continue;
		buf = found + strlen(str);

		if (!(found = strstr(buf, "</a> ("))) continue;
		list = realloc(list, sizeof(cnt_t) * ++llen);
		list[llen - 1].name = langs[i];
		list[llen - 1].count = strtol(found + 6, 0, 10);
	}
	*ret_len = llen;
	return list;
}

int _scmp(const void *a, const void *b)
{
	int x = ((const cnt_t*)a)->count, y = ((const cnt_t*)b)->count;
	return x < y ? -1 : x > y;
}

int main()
{
	int len, clen;
	char ** langs = get_langs(get_page(lang_url), &len);
	cnt_t *cats = get_cats(get_page(cat_url), langs, len, &clen);
	qsort(cats, clen, sizeof(cnt_t), _scmp);
	while (--clen >= 0)
		printf("%4d %s\n", cats[clen].count, cats[clen].name);

	return 0;
}
Task: Rosetta Code_Rank languages by popularity



C#: using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;

class Program
{
    static void Main(string[] args)
    {
        string get1 = new WebClient().DownloadString("http:
        string get2 = new WebClient().DownloadString("http:

        ArrayList langs = new ArrayList();
        Dictionary<string, int> qtdmbr = new Dictionary<string, int>();

        MatchCollection match1 = new Regex("\"title\":\"Category:(.+?)\"").Matches(get1);
        MatchCollection match2 = new Regex("title=\"Category:(.+?)\">.+?</a>[^(]*\\((\\d+) members\\)").Matches(get2);

        foreach (Match lang in match1) langs.Add(lang.Groups[1].Value);

        foreach (Match match in match2)
        {
            if (langs.Contains(match.Groups[1].Value))
            {
                qtdmbr.Add(match.Groups[1].Value, Int32.Parse(match.Groups[2].Value));
            }
        }

        string[] test = qtdmbr.OrderByDescending(x => x.Value).Select(x => String.Format("{0,3} - {1}", x.Value, x.Key)).ToArray();

        int count = 1;

        foreach (string i in test)
        {
            Console.WriteLine("{0,3}. {1}", count, i);
            count++;
        }
    }
}
Task: Rosetta Code_Rank languages by popularity


C++: #include <string>
#include <boost/regex.hpp>
#include <boost/asio.hpp>
#include <vector>
#include <utility>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <algorithm>
#include <iomanip>

struct Sort { 
   bool operator( ) ( const std::pair<std::string,int> & a , const std::pair<std::string,int> & b ) 
      const {
	 return a.second > b.second ;
      }
} ;

int main( ) {
   try {
      
      boost::asio::io_service io_service ; 
      boost::asio::ip::tcp::resolver resolver ( io_service ) ;
      boost::asio::ip::tcp::resolver::query query ( "rosettacode.org" , "http" ) ;
      boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve( query ) ;
      boost::asio::ip::tcp::resolver::iterator end ;
      boost::asio::ip::tcp::socket socket( io_service ) ;
      boost::system::error_code error = boost::asio::error::host_not_found ;
      
      while ( error && endpoint_iterator != end ) {
	 socket.close( ) ;
	 socket.connect( *endpoint_iterator++ , error ) ;
      }
      if ( error ) 
	 throw boost::system::system_error ( error ) ;
      
      boost::asio::streambuf request ;
      std::ostream request_stream( &request ) ;
      request_stream << "GET " << "/mw/index.php?title=Special:Categories&limit=5000" << " HTTP/1.0\r\n" ;
      request_stream << "Host: " << "rosettacode.org" << "\r\n" ;
      request_stream << "Accept: */*\r\n" ;
      request_stream << "Connection: close\r\n\r\n" ;
      
      boost::asio::write( socket , request ) ;
      
      boost::asio::streambuf response ;
      std::istream response_stream ( &response ) ;
      boost::asio::read_until( socket , response , "\r\n\r\n" ) ;
      boost::regex e( "<li><a href=\"[^<>]+?\">([a-zA-Z\\+#1-9]+?)</a>\\s?\\((\\d+) members\\)</li>" ) ;
      
      std::ostringstream line ;
      std::vector<std::pair<std::string , int> > languages ; 
      boost::smatch matches ;
      while ( boost::asio::read( socket , response , boost::asio::transfer_at_least( 1 ) , error ) ) {
	 line << &response ;
	 if ( boost::regex_search( line.str( ) , matches , e ) ) {
	    std::string lang( matches[2].first , matches[2].second ) ;
	    int zahl = atoi ( lang.c_str( ) ) ;
	    languages.push_back( std::make_pair( matches[ 1 ] , zahl ) ) ;
	 }
	 line.str( "") ;
      }
      if ( error != boost::asio::error::eof ) 
	 throw boost::system::system_error( error ) ;
      
      std::sort( languages.begin( ) , languages.end( ) , Sort( ) ) ;
      int n = 1 ;
      for ( std::vector<std::pair<std::string , int> >::const_iterator spi = languages.begin( ) ;
	    spi != languages.end( ) ; ++spi ) {
	 std::cout << std::setw( 3 ) << std::right << n << '.' << std::setw( 4 ) << std::right <<  
	 spi->second   << " - " << spi->first << '\n' ;
	 n++ ;
      }
   } catch ( std::exception &ex ) {
      std::cout << "Exception: " << ex.what( ) << '\n' ;
   }
   return 0 ;
}
Task: Rosetta Code_Rank languages by popularity







Python: import requests
import re

response = requests.get("http://rosettacode.org/wiki/Category:Programming_Languages").text
languages = re.findall('title="Category:(.*?)">',response)[:-3] 

response = requests.get("http://rosettacode.org/mw/index.php?title=Special:Categories&limit=5000").text
response = re.sub('(\d+),(\d+)',r'\1'+r'\2',response)           
members  = re.findall('<li><a[^>]+>([^<]+)</a>[^(]*[(](\\d+) member[s]*[)]</li>',response) 

for cnt, (language, members) in enumerate(sorted(members, key=lambda x: -int(x[1]))[:15]): 
    if language in languages:
        print("{:4d} {:4d} - {}".format(cnt+1, int(members), language))
Task: Rosetta Code_Rank languages by popularity




Go: package main

import (
	"encoding/xml"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
	"regexp"
	"sort"
	"strconv"
	"strings"
)

var baseQuery = "http:
	"&format=xml&list=categorymembers&cmlimit=500"

func req(u string, foundCm func(string)) string {
	resp, err := http.Get(u)
	if err != nil {
		log.Fatal(err) 
	}
	defer resp.Body.Close()
	for p := xml.NewDecoder(resp.Body); ; {
		t, err := p.RawToken()
		switch s, ok := t.(xml.StartElement); {
		case err == io.EOF:
			return ""
		case err != nil:
			log.Fatal(err)
		case !ok:
			continue
		case s.Name.Local == "cm":
			for _, a := range s.Attr {
				if a.Name.Local == "title" {
					foundCm(a.Value)
				}
			}
		case s.Name.Local == "categorymembers" && len(s.Attr) > 0 &&
			s.Attr[0].Name.Local == "cmcontinue":
			return url.QueryEscape(s.Attr[0].Value)
		}
	}
	return ""
}


type pop struct {
	string
	int
}
type popList []pop

func (pl popList) Len() int      { return len(pl) }
func (pl popList) Swap(i, j int) { pl[i], pl[j] = pl[j], pl[i] }
func (pl popList) Less(i, j int) bool {
	switch d := pl[i].int - pl[j].int; {
	case d > 0:
		return true
	case d < 0:
		return false
	}
	return pl[i].string < pl[j].string
}

func main() {
	
	langMap := make(map[string]bool)
	storeLang := func(cm string) {
		if strings.HasPrefix(cm, "Category:") {
			cm = cm[9:]
		}
		langMap[cm] = true
	}
	languageQuery := baseQuery + "&cmtitle=Category:Programming_Languages"
	continueAt := req(languageQuery, storeLang)
	for continueAt != "" {
		continueAt = req(languageQuery+"&cmcontinue="+continueAt, storeLang)
	}
	
	s := make(popList, 0, len(langMap))

	
	resp, err := http.Get("http:
		"?title=Special:Categories&limit=5000")
	if err != nil {
		log.Fatal(err)
	}
	page, err := ioutil.ReadAll(resp.Body)
	resp.Body.Close()

	
	rx := regexp.MustCompile("<li><a.*>(.*)</a>.*[(]([0-9]+) member")
	for _, sm := range rx.FindAllSubmatch(page, -1) {
		ls := string(sm[1])
		if langMap[ls] {
			if n, err := strconv.Atoi(string(sm[2])); err == nil {
				s = append(s, pop{ls, n})
			}
		}
	}

	
	sort.Sort(s)
	lastCnt, lastIdx := -1, 1
	for i, lang := range s {
		if lang.int != lastCnt {
			lastCnt = lang.int
			lastIdx = i + 1
		}
		fmt.Printf("%3d. %3d - %s\n", lastIdx, lang.int, lang.string)
	}
}
Task: Stable marriage problem








VB: Sub M_snb()
  c00 = "_abe abi eve cath ivy jan dee fay bea hope gay " & _
        "_bob cath hope abi dee eve fay bea jan ivy gay " & _
        "_col hope eve abi dee bea fay ivy gay cath jan " & _
        "_dan ivy fay dee gay hope eve jan bea cath abi " & _
        "_ed jan dee bea cath fay eve abi ivy hope gay " & _
        "_fred bea abi dee gay eve ivy cath jan hope fay " & _
        "_gav gay eve ivy bea cath abi dee hope jan fay " & _
        "_hal abi eve hope fay ivy cath jan bea gay dee " & _
        "_ian hope cath dee gay bea abi fay ivy jan eve " & _
        "_jon abi fay jan gay eve bea dee cath ivy hope " & _
        "_abi bob fred jon gav ian abe dan ed col hal " & _
        "_bea bob abe col fred gav dan ian ed jon hal " & _
        "_cath fred bob ed gav hal col ian abe dan jon " & _
        "_dee fred jon col abe ian hal gav dan bob ed " & _
        "_eve jon hal fred dan abe gav col ed ian bob " & _
        "_fay bob abe ed ian jon dan fred gav col hal " & _
        "_gay jon gav hal fred bob abe col ed dan ian " & _
        "_hope gav jon bob abe ian dan hal ed col fred " & _
        "_ivy ian col hal gav fred bob abe ed jon dan " & _
        "_jan ed hal gav abe bob jon col ian fred dan "
     
  sn = Filter(Filter(Split(c00), "_"), "-", 0)
  Do
    c01 = Mid(c00, InStr(c00, sn(0) & " "))
    st = Split(Left(c01, InStr(Mid(c01, 2), "_")))
      For j = 1 To UBound(st) - 1
        If InStr(c00, "_" & st(j) & " ") > 0 Then
          c00 = Replace(Replace(c00, sn(0), sn(0) & "-" & st(j)), "_" & st(j), "_" & st(j) & "." & Mid(sn(0), 2))
          Exit For
        Else
          c02 = Filter(Split(c00, "_"), st(j) & ".")(0)
          c03 = Split(Split(c02)(0), ".")(1)
          If InStr(c02, " " & Mid(sn(0), 2) & " ") < InStr(c02, " " & c03 & " ") Then
            c00 = Replace(Replace(Replace(c00, c03 & "-" & st(j), c03), sn(0), sn(0) & "-" & st(j)), "_" & st(j), "_" & st(j) & "." & Mid(sn(0), 2))
            Exit For
          End If
        End If
     Next
     sn = Filter(Filter(Filter(Split(c00), "_"), "-", 0), ".", 0)
   Loop Until UBound(sn) = -1
   
   MsgBox Replace(Join(Filter(Split(c00), "-"), vbLf), "_", "")
End Sub
Task: Loops_With multiple ranges



C#: using System;
using System.Collections.Generic;
using System.Linq;

public static class LoopsWithMultipleRanges
{
    public static void Main() {
        int prod = 1;
        int sum = 0;
        int x = 5;
        int y = -5;
        int z = -2;
        int one = 1;
        int three = 3;
        int seven = 7; 

        foreach (int j in Concat(
            For(-three, 3.Pow(3), three),
            For(-seven, seven, x),
            For(555, 550 - y),
            For(22, -28, -three),
            For(1927, 1939),
            For(x, y, z),
            For(11.Pow(x), 11.Pow(x) + one)
        )) {
            sum += Math.Abs(j);
            if (Math.Abs(prod) < (1 << 27) && j != 0) prod *= j;
        }
        Console.WriteLine($" sum = {sum:N0}");
        Console.WriteLine($"prod = {prod:N0}");
    }

    static IEnumerable<int> For(int start, int end, int by = 1) {
        for (int i = start; by > 0 ? (i <= end) : (i >= end); i += by) yield return i;
    }

    static IEnumerable<int> Concat(params IEnumerable<int>[] ranges) => ranges.Aggregate((acc, r) => acc.Concat(r));
    static int Pow(this int b, int e) => (int)Math.Pow(b, e);
}









Ada: with Ada.Text_IO; use Ada.Text_IO;
with Ada.Containers.Vectors;

procedure Main is
   package int_vector is new Ada.Containers.Vectors
     (Index_Type => Natural, Element_Type => Integer);
   use int_vector;

   summing_values : Vector := Empty_Vector;

   prod : Integer := 1;
   sum  : Integer := 0;
   x    : Integer := 5;
   y    : Integer := -5;
   z    : Integer := -2;
   N    : Integer;
begin
   N := -3;
   while N <= 3**3 loop
      summing_values.Append (N);
      N := N + 3;
   end loop;

   N := -7;
   while N <= 7 loop
      summing_values.Append (N);
      N := N + x;
   end loop;

   for I in 555 .. 550 - y loop
      summing_values.Append (I);
   end loop;

   N := 22;
   while N >= -28 loop
      summing_values.Append (N);
      N := N - 3;
   end loop;

   for I in 1_927 .. 1_939 loop
      summing_values.Append (I);
   end loop;

   N := x;
   while N >= y loop
      summing_values.Append (N);
      N := N + z;
   end loop;

   for I in 11**x .. 11**x + 1 loop
      summing_values.Append (I);
   end loop;

   for value of summing_values loop
      sum := sum + abs (value);
      if abs (prod) < 2**27 and then value /= 0 then
         prod := prod * value;
      end if;
   end loop;

   Put_Line ("sum = " & sum'Image);
   Put_Line ("prod = " & prod'Image);

end Main;
Task: Loops_With multiple ranges

C: #include <stdio.h>
#include <stdlib.h>
#include <locale.h>

long prod = 1L, sum = 0L;

void process(int j) {
    sum += abs(j);
    if (labs(prod) < (1 << 27) && j) prod *= j;
}

long ipow(int n, uint e) {
    long pr = n;
    int i;
    if (e == 0) return 1L;
    for (i = 2; i <= e; ++i) pr *= n;
    return pr;
}

int main() {
    int j;
    const int x = 5, y = -5, z = -2;
    const int one = 1, three = 3, seven = 7;
    long p = ipow(11, x);
    for (j = -three; j <= ipow(3, 3); j += three) process(j);
    for (j = -seven; j <= seven; j += x) process(j);
    for (j = 555; j <= 550 - y; ++j) process(j);
    for (j = 22; j >= -28; j -= three) process(j);
    for (j = 1927; j <= 1939; ++j) process(j);
    for (j = x; j >= y; j -= -z) process(j);
    for (j = p; j <= p + one; ++j) process(j);
    setlocale(LC_NUMERIC, "");
    printf("sum  = % 'ld\n", sum);
    printf("prod = % 'ld\n", prod);
    return 0;
}











Ada: with Ada.Text_IO; use Ada.Text_IO;
with Ada.Containers.Vectors;

procedure Main is
   package int_vector is new Ada.Containers.Vectors
     (Index_Type => Natural, Element_Type => Integer);
   use int_vector;

   summing_values : Vector := Empty_Vector;

   prod : Integer := 1;
   sum  : Integer := 0;
   x    : Integer := 5;
   y    : Integer := -5;
   z    : Integer := -2;
   N    : Integer;
begin
   N := -3;
   while N <= 3**3 loop
      summing_values.Append (N);
      N := N + 3;
   end loop;

   N := -7;
   while N <= 7 loop
      summing_values.Append (N);
      N := N + x;
   end loop;

   for I in 555 .. 550 - y loop
      summing_values.Append (I);
   end loop;

   N := 22;
   while N >= -28 loop
      summing_values.Append (N);
      N := N - 3;
   end loop;

   for I in 1_927 .. 1_939 loop
      summing_values.Append (I);
   end loop;

   N := x;
   while N >= y loop
      summing_values.Append (N);
      N := N + z;
   end loop;

   for I in 11**x .. 11**x + 1 loop
      summing_values.Append (I);
   end loop;

   for value of summing_values loop
      sum := sum + abs (value);
      if abs (prod) < 2**27 and then value /= 0 then
         prod := prod * value;
      end if;
   end loop;

   Put_Line ("sum = " & sum'Image);
   Put_Line ("prod = " & prod'Image);

end Main;
Task: Loops_With multiple ranges


C++: #include <iostream>
#include <cmath>
#include <vector>

using std::abs;
using std::cout;
using std::pow;
using std::vector;


int main()
{
    int prod  = 1,
        sum   = 0,
        x     = 5,
        y     = -5,
        z     = -2,
        one   = 1,
        three = 3,
        seven = 7;

    auto summingValues = vector<int>{};

    for(int n = -three; n <= pow(3, 3); n += three)
        summingValues.push_back(n);
    for(int n = -seven; n <= seven; n += x)
        summingValues.push_back(n);
    for(int n = 555; n <= 550 - y; ++n)
        summingValues.push_back(n);
    for(int n = 22; n >= -28; n -= three)
        summingValues.push_back(n);
    for(int n = 1927; n <= 1939; ++n)
        summingValues.push_back(n);
    for(int n = x; n >= y; n += z)
        summingValues.push_back(n);
    for(int n = pow(11, x); n <= pow(11, x) + one; ++n)
        summingValues.push_back(n);

    for(auto j : summingValues)
    {
        sum += abs(j);
        if(abs(prod) < pow(2, 27) && j != 0)
            prod *= j;
    }

    cout << "sum = " << sum << "\n";
    cout << "prod = " << prod << "\n";
}










Ada: with Ada.Text_IO; use Ada.Text_IO;
with Ada.Containers.Vectors;

procedure Main is
   package int_vector is new Ada.Containers.Vectors
     (Index_Type => Natural, Element_Type => Integer);
   use int_vector;

   summing_values : Vector := Empty_Vector;

   prod : Integer := 1;
   sum  : Integer := 0;
   x    : Integer := 5;
   y    : Integer := -5;
   z    : Integer := -2;
   N    : Integer;
begin
   N := -3;
   while N <= 3**3 loop
      summing_values.Append (N);
      N := N + 3;
   end loop;

   N := -7;
   while N <= 7 loop
      summing_values.Append (N);
      N := N + x;
   end loop;

   for I in 555 .. 550 - y loop
      summing_values.Append (I);
   end loop;

   N := 22;
   while N >= -28 loop
      summing_values.Append (N);
      N := N - 3;
   end loop;

   for I in 1_927 .. 1_939 loop
      summing_values.Append (I);
   end loop;

   N := x;
   while N >= y loop
      summing_values.Append (N);
      N := N + z;
   end loop;

   for I in 11**x .. 11**x + 1 loop
      summing_values.Append (I);
   end loop;

   for value of summing_values loop
      sum := sum + abs (value);
      if abs (prod) < 2**27 and then value /= 0 then
         prod := prod * value;
      end if;
   end loop;

   Put_Line ("sum = " & sum'Image);
   Put_Line ("prod = " & prod'Image);

end Main;
Task: Loops_With multiple ranges




Go: package main

import "fmt"

func pow(n int, e uint) int {
    if e == 0 {
        return 1
    }
    prod := n
    for i := uint(2); i <= e; i++ {
        prod *= n
    }
    return prod
}

func abs(n int) int {
    if n >= 0 {
        return n
    }
    return -n
}

func commatize(n int) string {
    s := fmt.Sprintf("%d", n)
    if n < 0 {
        s = s[1:]
    }
    le := len(s)
    for i := le - 3; i >= 1; i -= 3 {
        s = s[0:i] + "," + s[i:]
    }
    if n >= 0 {
        return " " + s
    }
    return "-" + s
}

func main() {
    prod := 1
    sum := 0
    const (
        x     = 5
        y     = -5
        z     = -2
        one   = 1
        three = 3
        seven = 7
    )
    p := pow(11, x)
    var j int

    process := func() {
        sum += abs(j)
        if abs(prod) < (1<<27) && j != 0 {
            prod *= j
        }
    }

    for j = -three; j <= pow(3, 3); j += three {
        process()
    }
    for j = -seven; j <= seven; j += x {
        process()
    }
    for j = 555; j <= 550-y; j++ {
        process()
    }
    for j = 22; j >= -28; j -= three {
        process()
    }
    for j = 1927; j <= 1939; j++ {
        process()
    }
    for j = x; j >= y; j -= -z {
        process()
    }
    for j = p; j <= p+one; j++ {
        process()
    }
    fmt.Println("sum  = ", commatize(sum))
    fmt.Println("prod = ", commatize(prod))
}








Ada: with Ada.Text_IO; use Ada.Text_IO;
with Ada.Containers.Vectors;

procedure Main is
   package int_vector is new Ada.Containers.Vectors
     (Index_Type => Natural, Element_Type => Integer);
   use int_vector;

   summing_values : Vector := Empty_Vector;

   prod : Integer := 1;
   sum  : Integer := 0;
   x    : Integer := 5;
   y    : Integer := -5;
   z    : Integer := -2;
   N    : Integer;
begin
   N := -3;
   while N <= 3**3 loop
      summing_values.Append (N);
      N := N + 3;
   end loop;

   N := -7;
   while N <= 7 loop
      summing_values.Append (N);
      N := N + x;
   end loop;

   for I in 555 .. 550 - y loop
      summing_values.Append (I);
   end loop;

   N := 22;
   while N >= -28 loop
      summing_values.Append (N);
      N := N - 3;
   end loop;

   for I in 1_927 .. 1_939 loop
      summing_values.Append (I);
   end loop;

   N := x;
   while N >= y loop
      summing_values.Append (N);
      N := N + z;
   end loop;

   for I in 11**x .. 11**x + 1 loop
      summing_values.Append (I);
   end loop;

   for value of summing_values loop
      sum := sum + abs (value);
      if abs (prod) < 2**27 and then value /= 0 then
         prod := prod * value;
      end if;
   end loop;

   Put_Line ("sum = " & sum'Image);
   Put_Line ("prod = " & prod'Image);

end Main;