A - Doors in the Center
Source: atcoder
Difficulty: 100

Problem Statement
Find a length-
N
string that satisfies all of the following conditions:
Each character is
-
or
=
.
It is a palindrome.
It contains exactly one or exactly two
=
s. If it contains two
=
s, they are adjacent.
Such a string is unique.
Constraints
1 \leq N \leq 100
N
is an integer.
Input
The input is given from Standard Input in the following format:
N
Output
Print the answer.
Sample Input 1
4
Sample Output 1
-==-
Sample Input 2
7
Sample Output 2
---=---

C++ solution:
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <set>
#include <map>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<ll> vll;

int main() {
  int n;
  cin >> n;
  string s;
  if (n % 2) s= "="; else s = "==";
  while (s.size() < n) s = "-" + s + "-";
  cout << s << endl;

  return 0;
}

Go solution:
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	N, _ := strconv.Atoi(scanner.Text())
	var s string

	if N%2 == 0 {
		s = strings.Repeat("-", N/2-1) + "==" + strings.Repeat("-", N/2-1)
	}
	if N%2 != 0 {
		s = strings.Repeat("-", N/2) + "=" + strings.Repeat("-", N/2)
	}

	fmt.Println(s)
}

Java solution:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) {
		String str1;
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			str1 = br.readLine();
		}catch (Exception e) {
			System.out.println("Input Error!!");
			return;
		}
		String[] sa = str1.split(" ");
		ArrayList<Integer> il = new ArrayList<Integer>();
		for(String s:sa) {
			il.add(Integer.parseInt(s));
		}
		aDoorsintheCenter(il);
	}
	private static void aDoorsintheCenter(ArrayList<Integer> il) {
		String ans = "";
		double v = il.get(0);
		int border = (int)v / 2;
		boolean odd = v % 2 == 1;
		if(odd) border++;
		if(odd) {
			for(int i = 0; i < il.get(0); i++) {
				if(i == border-1) {
					ans += "=";
				} else {
					ans += "-";
				}
			}
		}else {
			for(int i = 0; i < il.get(0); i++) {
				if(i == border-1 || i == border) {
					ans += "=";
				} else {
					ans += "-";
				}
			}
		}
		System.out.println(ans);
	}
}

JavaScript solution:
const N = require('fs').readFileSync('/dev/stdin', 'utf-8');

const chars = '-'.repeat(N);

const center = Math.floor(N / 2);
if(N % 2 === 1) {
    console.log(
        chars.slice(0, center) + '=' + chars.slice(center + 1)
    )
} else {
    console.log(
        chars.slice(0, center - 1) + '==' + chars.slice(center + 1)
    )
}

Python solution:
N = int(input())

ans = ["-"]*N
if N%2 == 0:
    ans[N//2] = "="
    ans[N//2-1] = "="
else:
    ans[N//2] = "="

ans = "".join(ans)
print(ans)

Ruby solution:
n = gets.to_i
a = n / 2 -1
b = (n - 1) / 2

if n % 2 == 0 && n >= 0
  print '-' * a + '==' + '-' * a
elsif n % 2 == 1
  print '-' * b + '=' + '-' * b
end