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

(새 문서: 분류: 30 Days of Code ==개요== ;Day 0: Hello, World. * https://www.hackerrank.com/challenges/30-hello-world/problem ==Python== <source lang='Python'> input_string = input() p...)
 
잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 32개는 보이지 않습니다)
1번째 줄: 1번째 줄:
[[분류: 30 Days of Code]]
==개요==
==개요==
;Day 0: Hello, World.
;<nowiki>Day 0: Hello, World.</nowiki>
* https://www.hackerrank.com/challenges/30-hello-world/problem
* https://www.hackerrank.com/challenges/30-hello-world/problem
{{youtube|K5WxmFfIWbo}}
{{HR30 헤더}}
{{HR30 0-9}}
|}
==같이 보기==
* [[Hello World 프로그램]]
* [[해커랭크 30 Days of Code]]
==C==
<syntaxhighlight lang='c'>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
</syntaxhighlight>
<syntaxhighlight lang='c'>
int main() {
    char input_string[105];
    scanf("%[^\n]", input_string);
    printf("Hello, World.\n");
    printf("%s\n", input_string);
    return 0;
}
</syntaxhighlight>
==C++==
<syntaxhighlight lang='cpp'>
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
</syntaxhighlight>
<syntaxhighlight lang='cpp'>
int main() {
    string input_string;
    getline(cin, input_string);
    cout << "Hello, World." << endl;
    cout << input_string << endl;
    return 0;
}
</syntaxhighlight>
==C#==
<syntaxhighlight lang='csharp'>
class Solution {
    static void Main(String[] args) {
        String inputString;
        inputString = Console.ReadLine();
        Console.WriteLine("Hello, World.");
        Console.WriteLine(inputString);
    }
}
</syntaxhighlight>
==Go==
<syntaxhighlight lang='go'>
package main
import (
    "fmt"
    "os"
    "bufio"
)
func main() {
    reader := bufio.NewReader(os.Stdin)
    input_string, _ := reader.ReadString('\n')
    fmt.Println("Hello, World.")
    fmt.Println(input_string)
}
</syntaxhighlight>
==Java==
<syntaxhighlight lang='java'>
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
</syntaxhighlight>
<syntaxhighlight 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 );
}
}
</syntaxhighlight>
==node.js==
<syntaxhighlight lang='javascript'>
function processData(inputString) {
    console.log("Hello, World.");
    console.log(inputString);
}
</syntaxhighlight>
<syntaxhighlight lang='javascript'>
process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});
process.stdin.on("end", function () {
  processData(_input);
});
</syntaxhighlight>
==Perl==
<syntaxhighlight lang='perl'>
my $inputString = <STDIN>;
print "Hello, World.\n";
print $inputString;
</syntaxhighlight>
==PHP==
<syntaxhighlight lang='Python'>
<?php
$_fp = fopen("php://stdin", "r");
$input_string = fgets($_fp);
print("Hello, World.\n");
echo $input_string;
fclose($_fp);
</syntaxhighlight>


==Python==
==Python==
<source lang='Python'>
<syntaxhighlight lang='Python'>
input_string = input()
input_string = input()
print('Hello, World.')
print('Hello, World.')
print(input_string)
print(input_string)
</source>
</syntaxhighlight>
 
==Ruby==
<syntaxhighlight lang='ruby'>
input_string = gets
puts 'Hello, World.'
puts input_string
</syntaxhighlight>

2021년 7월 31일 (토) 10:34 기준 최신판

1 개요[ | ]

Day 0: Hello, World.
해커랭크 30 Days of Code
문제 풀이
0-9 Day e
HR30 Day 0: Hello, World.

HR30 Day 1: Data Types

HR30 Day 2: Operators

HR30 Day 3: Intro to Conditional Statements

HR30 Day 4: Class vs. Instance

HR30 Day 5: Loops

HR30 Day 6: Let's Review

HR30 Day 7: Arrays

HR30 Day 8: Dictionaries and Maps

HR30 Day 9: Recursion

2 같이 보기[ | ]

3 C[ | ]

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
    char input_string[105]; 
    scanf("%[^\n]", input_string); 
    printf("Hello, World.\n");
    printf("%s\n", input_string);
    return 0;
}

4 C++[ | ]

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    string input_string; 
    getline(cin, input_string); 
    cout << "Hello, World." << endl;
    cout << input_string << endl;
    return 0;
}

5 C#[ | ]

class Solution {
    static void Main(String[] args) {
        String inputString; 
        inputString = Console.ReadLine(); 
        Console.WriteLine("Hello, World.");
        Console.WriteLine(inputString);
    }
}

6 Go[ | ]

package main
import (
    "fmt"
    "os"
    "bufio"
)
func main() {
    reader := bufio.NewReader(os.Stdin)
    input_string, _ := reader.ReadString('\n')
    fmt.Println("Hello, World.") 
    fmt.Println(input_string) 
}

7 Java[ | ]

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
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 );
	}
}

8 node.js[ | ]

function processData(inputString) {
    console.log("Hello, World.");
    console.log(inputString);
}
process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});

process.stdin.on("end", function () {
   processData(_input);
});

9 Perl[ | ]

my $inputString = <STDIN>;
print "Hello, World.\n";
print $inputString;

10 PHP[ | ]

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

11 Python[ | ]

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

12 Ruby[ | ]

input_string = gets
puts 'Hello, World.'
puts input_string
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}