Getting Started
The following video demonstrates how to use the block based editor for the block-based challenges on this site:
The following video demonstrates how to use the text based editor for the text-based challenges on this site:
Text based coding challenge notes:
-
Do not include any extra printed messages or input prompts in your submission code: your only output must be the requested result.
-
Rough paper or calculators may be used if helpful.
-
Although you can code directly into the submission editor (and use the Run button before the Submit button to test with custom data), it is easier to use a coding environment such as an installed IDE.
- If the compiler is not showing, refresh your page and it will appear. This will not change your score.
Code snippets:
All of these examples show the answer in different languages to the first question of the Navigators specimen challenge, full name.
The examples take two lines of input; the first line will contain a first name and the second line will contain a last name.
The output is a single line containing the two names separated by a space.
For languages such as Java/C# which require a class definition, the main class should be called: solution.
Python
#Get input fname = input() lname = input() # output print(fname, lname)
C#
using System; class Program { static void Main() { Console.Write(""); string firstName = Console.ReadLine(); // Input Console.Write(""); string surname = Console.ReadLine(); // Input string fullName = firstName + " " + surname; // Processing Console.WriteLine(fullName); // Output } }
Java
import java.util.Scanner; public class solution { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(""); String firstName = scanner.nextLine(); // Input System.out.print(""); String surname = scanner.nextLine(); // Input String fullName = firstName + " " + surname; // Processing System.out.println(fullName); // Output
VB
Module Module1 Sub Main() Console.Write("") Dim firstName As String = Console.ReadLine() Console.Write("") Dim surname As String = Console.ReadLine() Dim fullName As String = firstName & " " & surname Console.WriteLine(fullName) 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"); // Split input into array (line by line) stdin_arr.reverse(); // Reverse to use `.pop()` in order main(); // Call main function after input is received }); process.stdin.resume(); function main() { let firstName = prompt(); // Get first input let lastName = prompt(); // Get second input console.log(firstName + " " + lastName); // Output full name }
Did you know the UK Bebras Challenge is run by the Raspberry Pi Foundation? Discover free teaching resources, tools, and expert support for computing education at raspberrypi.org.