Language: C++

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
	"sort"
)

type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextInt64() int64 {
	i, err := strconv.ParseInt(io.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}


func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) PrintLn(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func intMin(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func intMax(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func absi(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func b2i(b bool) int {
	if b {
		return 1
	}
	return 0
}

type Int64s []int64
func (f Int64s) Len() int {
	return len(f)
}
func (f Int64s) Less(i, j int) bool {
	return f[i] < f[j]
}

func (f Int64s) Swap(i, j int) {
	f[i], f[j] = f[j], f[i]
}


func solve(io *Io) {
	a := make([]int, 3)
	for i := range(a) {
		a[i] = io.NextInt()
	}
	sort.Ints(a)

	io.PrintLn(a[2] - a[0])
}

func main() {
	io := NewIo()
	defer io.Flush()

	solve(io)
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:19:1: error: 'func' does not name a type
   19 | func NewIo() *Io {
      | ^~~~
a.cc:26:6: error: expected constructor, destructor, or type conversion before '(' token
   26 | func (io *Io) Flush() {
      |      ^
a.cc:33:6: error: expected constructor, destructor, or type conversion before '(' token
   33 | func (io *Io) NextLine() string {
      |      ^
a.cc:48:6: error: expected constructor, destructor, or type conversion before '(' token
   48 | func (io *Io) Next() string {
      |      ^
a.cc:59:6: error: expected constructor, destructor, or type conversion before '(' token
   59 | func (io *Io) NextInt() int {
      |      ^
a.cc:67:6: error: expected constructor, destructor, or type conversion before '(' token
   67 | func (io *Io) NextInt64() int64 {
      |      ^
a.cc:76:6: error: expected constructor, destructor, or type conversion before '(' token
   76 | func (io *Io) NextFloat() float64 {
      |      ^
a.cc:84:6: error: expected constructor, destructor, or type conversion before '(' token
   84 | func (io *Io) PrintLn(a ...interface{}) {
      |      ^
a.cc:84:39: error: expected unqualified-id before ')' token
   84 | func (io *Io) PrintLn(a ...interface{}) {
      |                                       ^
a.cc:88:6: error: expected constructor, destructor, or type conversion before '(' token
   88 | func (io *Io) Printf(format string, a ...interface{}) {
      |      ^
a.cc:88:53: error: expected unqualified-id before ')' token
   88 | func (io *Io) Printf(format string, a ...interface{}) {
      |                                                     ^
a.cc:92:1: error: 'func' does not name a type
   92 | func intMin(a, b int) int {
      | ^~~~
a.cc:99:1: error: 'func' does not name a type
   99 | func intMax(a, b int) int {
      | ^~~~
a.cc:106:1: error: 'func' does not name a type
  106 | func absi(a int) int {
      | ^~~~
a.cc:114:1: error: 'func' does not name a type
  114 | func b2i(b bool) int {
      | ^~~~
a.cc:121:1: error: 'type' does not name a type; did you mean 'typeof'?
  121 | type Int64s []int64
      | ^~~~
      | typeof
a.cc:125:6: error: expected constructor, destructor, or type conversion before '(' token
  125 | func (f Int64s) Less(i, j int) bool {
      |      ^
a.cc:129:6: error: expected constructor, destructor, or type conversion before '(' token
  129 | func (f Int64s) Swap(i, j int) {
      |      ^
a.cc:134:1: error: 'func' does not name a type
  134 | func solve(io *Io) {
      | ^~~~
a.cc:144:1: error: 'func' does not name a type
  144 | func main() {
      | ^~~~