.

 
 

This video introduces our challenge and demonstrates how to use the code editor/grader on this site:

NOTES:

CODE SNIPPETS:

All inputs should be read from standard in and outputs printed to standard out.

These examples all read a single integer and print double that number out.

Python:
num = int(input())
print(num * 2)
Java:
import java.io.*;
import java.util.*;

public class Solution {
public static void main(String[] args) {
    // Enter your code here
    Scanner scanner = new Scanner(System.in);
int num = scanner.nextInt();
System.out.println(num * 2);
}
}

C#:
using System;
using System.Collections.Generic;
using System.IO;

class Solution {
static void Main(String[] args) {
// Enter your code here
int num = Int32.Parse(Console.ReadLine());
Console.WriteLine(num * 2);
}
}

VB.NET:

Module Solution
Sub Main()
' Enter your code here
Dim num As Integer = Integer.Parse(Console.ReadLine())
Console.WriteLine(num * 2)
End Sub
End Module

JavaScript (Node.js)
process.stdin.setEncoding('ascii');
var stdin = "";
var stdin_arr;
var prompt = () => stdin_arr.pop();
process.stdin.on('data', (data) => {stdin += data});
process.stdin.on('end', () => {stdin_arr = stdin.split("\n");stdin_arr.reverse();main()});
process.stdin.resume();

function main() {
// Enter your code here
  var num = parseInt(prompt());
    console.log(num * 2);
}

C++ 11:

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
// Enter your code here
string sNum;
getline(cin, sNum);
int num = stoi(sNum);
cout << num * 2 << "\n";
return 0;
}

Note: one advantage of using getline for c++ input is that when multiple values are provided on one line of input (e.g. 2 3 5 7) then you can easily read through to the next delimeter e.g.

getline(cin, sNum, ' ');

However, of course, you could also in this case just do the shorter:

#include <iostream>
using namespace std;

int main() {
  // Enter your code here
  int num;
  cin >> num;
  cout << num * 2 << "\n";
  return 0;
}