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

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 6개는 보이지 않습니다)
1번째 줄: 1번째 줄:
[[분류: 30 Days of Code]]
==개요==
==개요==
;<nowiki>Day 0: Hello, World.</nowiki>
;<nowiki>Day 0: Hello, World.</nowiki>
9번째 줄: 8번째 줄:
{{HR30 0-9}}
{{HR30 0-9}}
|}
|}
==같이 보기==
* [[Hello World 프로그램]]
* [[해커랭크 30 Days of Code]]


==C==
==C==
<source lang='c'>
<syntaxhighlight lang='c'>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <math.h>
#include <math.h>
#include <stdlib.h>
#include <stdlib.h>
</source>
</syntaxhighlight>
<source lang='c'>
<syntaxhighlight lang='c'>
int main() {
int main() {
     char input_string[105];  
     char input_string[105];  
25번째 줄: 28번째 줄:
     return 0;
     return 0;
}
}
</source>
</syntaxhighlight>


==C++==
==C++==
<source lang='cpp'>
<syntaxhighlight lang='cpp'>
#include <cmath>
#include <cmath>
#include <cstdio>
#include <cstdio>
35번째 줄: 38번째 줄:
#include <algorithm>
#include <algorithm>
using namespace std;
using namespace std;
</source>
</syntaxhighlight>
<source lang='cpp'>
<syntaxhighlight lang='cpp'>
int main() {
int main() {
     string input_string;  
     string input_string;  
44번째 줄: 47번째 줄:
     return 0;
     return 0;
}
}
</source>
</syntaxhighlight>


==C#==
==C#==
<source lang='csharp'>
<syntaxhighlight lang='csharp'>
class Solution {
class Solution {
     static void Main(String[] args) {
     static void Main(String[] args) {
56번째 줄: 59번째 줄:
     }
     }
}
}
</source>
</syntaxhighlight>


==Go==
==Go==
<source lang='go'>
<syntaxhighlight lang='go'>
package main
package main
import (
import (
72번째 줄: 75번째 줄:
     fmt.Println(input_string)  
     fmt.Println(input_string)  
}
}
</source>
</syntaxhighlight>


==Java==
==Java==
<source lang='java'>
<syntaxhighlight lang='java'>
import java.io.*;
import java.io.*;
import java.util.*;
import java.util.*;
81번째 줄: 84번째 줄:
import java.math.*;
import java.math.*;
import java.util.regex.*;
import java.util.regex.*;
</source>
</syntaxhighlight>
<source lang='Java'>
<syntaxhighlight lang='Java'>
public class Solution {
public class Solution {
public static void main(String[] args) {
public static void main(String[] args) {
92번째 줄: 95번째 줄:
}
}
}
}
</source>
</syntaxhighlight>


==node.js==
==node.js==
<source lang='javascript'>
<syntaxhighlight lang='javascript'>
function processData(inputString) {
function processData(inputString) {
     console.log("Hello, World.");
     console.log("Hello, World.");
     console.log(inputString);
     console.log(inputString);
}
}
</source>
</syntaxhighlight>
<source lang='javascript'>
<syntaxhighlight lang='javascript'>
process.stdin.resume();
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.setEncoding("ascii");
112번째 줄: 115번째 줄:
   processData(_input);
   processData(_input);
});
});
</source>
</syntaxhighlight>


==Perl==
==Perl==
<source lang='perl'>
<syntaxhighlight lang='perl'>
my $inputString = <STDIN>;
my $inputString = <STDIN>;
print "Hello, World.\n";
print "Hello, World.\n";
print $inputString;
print $inputString;
</source>
</syntaxhighlight>


==PHP==
==PHP==
<source lang='Python'>
<syntaxhighlight lang='Python'>
<?php
<?php
$_fp = fopen("php://stdin", "r");
$_fp = fopen("php://stdin", "r");
129번째 줄: 132번째 줄:
echo $input_string;
echo $input_string;
fclose($_fp);
fclose($_fp);
</source>
</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==
==Ruby==
<source lang='ruby'>
<syntaxhighlight lang='ruby'>
input_string = gets
input_string = gets
puts 'Hello, World.'
puts 'Hello, World.'
puts input_string
puts input_string
</source>
</syntaxhighlight>
 
==같이 보기==
* [[해커랭크 30 Days of Code]]
* [[Hello World 프로그램]]

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 }}