Language: C++

package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

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

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type Val struct {
	id, num int
}
type ByNum []Val

func (a ByNum) Len() int           { return len(a) }
func (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }
func (a ByNum) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	a, b, c := sc.nextInt(), sc.nextInt(), sc.nextInt()
	if (b - a) == (c - b) {
		fmt.Fprintln(wtr, "YES")
	} else {
		fmt.Fprintln(wtr, "NO")
	}

	wtr.Flush()
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:15:1: error: 'func' does not name a type
   15 | func NewScanner() *Scanner {
      | ^~~~
a.cc:22:6: error: expected constructor, destructor, or type conversion before '(' token
   22 | func (s *Scanner) nextStr() string {
      |      ^
a.cc:27:6: error: expected constructor, destructor, or type conversion before '(' token
   27 | func (s *Scanner) nextInt() int {
      |      ^
a.cc:35:6: error: expected constructor, destructor, or type conversion before '(' token
   35 | func (s *Scanner) nextFloat() float64 {
      |      ^
a.cc:43:6: error: expected constructor, destructor, or type conversion before '(' token
   43 | func (s *Scanner) nextRuneSlice() []rune {
      |      ^
a.cc:47:6: error: expected constructor, destructor, or type conversion before '(' token
   47 | func (s *Scanner) nextIntSlice(n int) []int {
      |      ^
a.cc:55:6: error: expected constructor, destructor, or type conversion before '(' token
   55 | func (s *Scanner) nextFloatSlice(n int) []float64 {
      |      ^
a.cc:64:1: error: 'func' does not name a type
   64 | func max(nums ...int) int {
      | ^~~~
a.cc:74:1: error: 'func' does not name a type
   74 | func min(nums ...int) int {
      | ^~~~
a.cc:84:1: error: 'func' does not name a type
   84 | func abs(x int) int {
      | ^~~~
a.cc:91:1: error: 'func' does not name a type
   91 | func pow(x, y int) int {
      | ^~~~
a.cc:100:1: error: 'type' does not name a type; did you mean 'typeof'?
  100 | type Val struct {
      | ^~~~
      | typeof
a.cc:103:1: error: 'type' does not name a type; did you mean 'typeof'?
  103 | type ByNum []Val
      | ^~~~
      | typeof
a.cc:106:6: error: expected constructor, destructor, or type conversion before '(' token
  106 | func (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }
      |      ^
a.cc:107:6: error: expected constructor, destructor, or type conversion before '(' token
  107 | func (a ByNum) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
      |      ^
a.cc:109:1: error: 'func' does not name a type
  109 | func main() {
      | ^~~~