Editorial for Nhân hai


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.

\(\color{red}{\text{Spoiler Alert}_{{}_{{}^{{}^{v2.0}}}}}\)

\(\color{red}{\text{Khuyến khích bạn đọc trước khi đọc phần lời giải xin hãy thử code ra thuật của mình dù nó có sai hay đúng}}\)

\(\color{red}{\text{Sau đó từ phần bài giải và thuật toán trước đó mà đối chiếu, rút nhận xét với thuật của mình và thu được bài học (không lãng phí thời gian đâu).}}\)



\(\color{goldenrod}{\text{C++}}\)

C++
#include <iostream>

int main() {
    int x;
    cin >> x;
    std::cout << x * 2;
    return 0;
}

\(\color{goldenrod}{\text{AWK}}\)

Awk
{print $1 * 2}

\(\color{goldenrod}{\text{perl}}\)

Perl
my ($a) = scalar(<STDIN>);
print ($a * 2);

\(\color{goldenrod}{\text{java}}\)

Java
import java.util.Scanner;

public class Sum2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println(in.nextInt() * 2);
    }
}

\(\color{goldenrod}{\text{pascal}}\)

Delphi
var a: integer;
begin
   readln(a);
   writeln(a * 2);
end.

\(\color{goldenrod}{\text{python}}\)

Python
x = int(input())
print (x * 2)


Comments

There are no comments at the moment.