Skip to content

Instantly share code, notes, and snippets.

@rsandhusdg
Forked from saikatdas/DayZero.java
Created April 5, 2021 20:21
Show Gist options
  • Save rsandhusdg/196b4e85a274a236c22f8c2920ada4a8 to your computer and use it in GitHub Desktop.
Save rsandhusdg/196b4e85a274a236c22f8c2920ada4a8 to your computer and use it in GitHub Desktop.

Revisions

  1. @saikatdas saikatdas created this gist Dec 9, 2017.
    32 changes: 32 additions & 0 deletions DayZero.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    /*Day 0: Hello, World*/
    /*To complete this challenge, you must save a line of input from stdin to a variable, print Hello, World. on a single line, and finally print the value of your variable on a second line.*/
    /*https://www.hackerrank.com/challenges/30-hello-world*/
    /*The problem statement has been taken from HackerRank.Credits to HackerRank and the problem setter.
    I do not claim any copy right or warranty.
    */
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import java.math.*;
    import java.util.regex.*;


    public class DayZero {
    public static void main(String[] args) {
    // Create a Scanner object to read input from stdin.
    Scanner scan = new Scanner(System.in);

    // Read a full line of input from stdin and save it to our variable, inputString.
    String inputString = scan.nextLine();

    // Close the scanner object, because we've finished reading
    // all of the input from stdin needed for this challenge.
    scan.close();

    // Print a string literal saying "Hello, World." to stdout.
    System.out.println("Hello, World.");

    // TODO: Write a line of code here that prints the contents of inputString to stdout.
    System.out.println(inputString );
    }
    }