Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://www.hackerrank.com/challenges/30-hello-world/
- -- Example in java --
- Scanner scan = new Scanner(System.in); // open scanner
- String s = scan.next(); // read the next token and save it to 's'
- scan.close(); // close scanner
- System.out.println(s); // print 's' to System.out, followed by a new line
- // - or -
- System.out.println("Input received: " + s);
- -- Task in C# --
- class Solution {
- static void Main(String[] args) {
- // Declare a variable named 'inputString' to hold our input.
- String inputString;
- // Read a full line of input from stdin (cin) and save it to our variable, inputString.
- inputString = Console.ReadLine();
- // Print a string literal saying "Hello, World." to stdout using cout.
- Console.WriteLine("Hello, World.");
- // TODO: Write a line of code here that prints the contents of inputString to stdout.
- Console.WriteLine(inputString);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement