A - 9x9
Source: atcoder
Difficulty: 100

Problem Statement
You are given a
3
-character string
S
, where the first character is a digit, the second character is the character
x
, and the third character is a digit.
Find the product of the two numbers in
S
.
Constraints
S
is a
3
-character string where the first character is an integer between
1
and
9
, inclusive, the second character is the character
x
, and the third character is an integer between
1
and
9
, inclusive.
Input
The input is given from Standard Input in the following format:
S
Output
Print the answer as an integer.
Sample Input 1
3x8
Sample Output 1
24
From
3 \times 8 = 24
, print
24
.
Sample Input 2
9x9
Sample Output 2
81
From
9 \times 9 = 81
, print
81
.

C++ solution:
#include <bits/stdc++.h>
using namespace std;

int main() {
  string S;
  cin >> S;
  cout << (S.at(0) - '0') * (S.at(2) - '0') << endl;
}

Go solution:
package main

import (
    "fmt"
)

func main() {
    var text string
    fmt.Scan(&text)
    a := int(text[0] - '0')
    b := int(text[2] - '0')
    fmt.Println(a * b)
}

Java solution:
import java.io.*;

// 処理
class Process {
    private String S;

    Process(String S) {
        this.S = S;
    }

    int getResult() {
        return (Integer.parseInt(S.substring(0, 1)) * Integer.parseInt(S.substring(2, 3)));
    }
}

public class Main {
    public static void main(String[] args) throws IOException {
        var bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        var printWriter    = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

        // 入力
        String S = bufferedReader.readLine().trim();

        // 出力
        printWriter.println((new Process(S)).getResult());

        bufferedReader.close();
        printWriter.close();
    }
}

JavaScript solution:
const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
const [a, b] = input[0].split('x').map(Number);
console.log(a * b);

Python solution:
S = input()
print(int(S[0]) * int(S[2]))

Ruby solution:
a,_,b = gets.chomp.split('')

puts a.to_i * b.to_i