"HR30 Day 0: Hello, World."의 두 판 사이의 차이

3번째 줄: 3번째 줄:
;<nowiki>Day 0: Hello, World.</nowiki>
;<nowiki>Day 0: Hello, World.</nowiki>
* https://www.hackerrank.com/challenges/30-hello-world/problem
* https://www.hackerrank.com/challenges/30-hello-world/problem
==Java==
<source lang='Java'>
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String inputString = scan.nextLine();
scan.close();
        System.out.println("Hello, World.");
        System.out.println( inputString );
}
}
</source>


==PHP==
==PHP==

2018년 7월 28일 (토) 17:36 판

1 개요

Day 0: Hello, World.

2 Java

public class Solution {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in); 
		String inputString = scan.nextLine(); 
		scan.close(); 
        System.out.println("Hello, World.");
        System.out.println( inputString );
	}
}

3 PHP

<?php
$_fp = fopen("php://stdin", "r");
$inputString = fgets($_fp);
print("Hello, World.\n");
echo $inputString;
fclose($_fp);

4 Python

input_string = input()
print('Hello, World.')
print(input_string)

5 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}