白駿[2556]ハローワールド
6833 ワード
std:sout
および<<
入力>>
NodeJS
version : v14.15.0
console.log("Hello World!");
C++
version : 17
#include <iostream>
using namespace std;
int main() {
cout << "Hello World!" << endl;
return 0;
}
assembly
version : x86-64 gcc 11.2
.LC0:
.string "Hello World!"
main:
push rbp
mov rbp, rsp
mov esi, OFFSET FLAT:.LC0
mov edi, OFFSET FLAT:_ZSt4cout
call std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
mov esi, OFFSET FLAT:_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
mov rdi, rax
call std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))
mov eax, 0
pop rbp
ret
__static_initialization_and_destruction_0(int, int):
push rbp
mov rbp, rsp
sub rsp, 16
mov DWORD PTR [rbp-4], edi
mov DWORD PTR [rbp-8], esi
cmp DWORD PTR [rbp-4], 1
jne .L5
cmp DWORD PTR [rbp-8], 65535
jne .L5
mov edi, OFFSET FLAT:_ZStL8__ioinit
call std::ios_base::Init::Init() [complete object constructor]
mov edx, OFFSET FLAT:__dso_handle
mov esi, OFFSET FLAT:_ZStL8__ioinit
mov edi, OFFSET FLAT:_ZNSt8ios_base4InitD1Ev
call __cxa_atexit
.L5:
nop
leave
ret
_GLOBAL__sub_I_main:
push rbp
mov rbp, rsp
mov esi, 65535
mov edi, 1
call __static_initialization_and_destruction_0(int, int)
pop rbp
ret
JAVA
version : 11
import java.util.*;
public class Main{
public static void main(String args[]){
System.out.println("Hello World!");
}
}
assembly
version: Open JDK 16
Main.class
Classfile /tmp/4559304259719885153/classes/Main.class
Last modified Aug 7, 2021; size 516 bytes
SHA-256 checksum 4d6f662e03d3304d5e46fcf266c182e838aba95999d4c19afd5b697ed5180ddf
Compiled from "Main.java"
public class Main
minor version: 0
major version: 60
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #21 // Main
super_class: #2 // java/lang/Object
interfaces: 0, fields: 0, methods: 2, attributes: 1
Constant pool:
{
public Main();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 // Main this
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
end local 0 // Main this
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this LMain;
public static void main(java.lang.String[]);
descriptor: ([Ljava/lang/String;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 // java.lang.String[] args
0: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #13 // String Hello World!
5: invokevirtual #15 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
8: return
end local 0 // java.lang.String[] args
LineNumberTable:
LocalVariableTable:
Start Length Slot Name Signature
0 9 0 args [Ljava/lang/String;
}
SourceFile: "Main.java"
Reference
この問題について(白駿[2556]ハローワールド), 我々は、より多くの情報をここで見つけました https://velog.io/@afashs/백준-2556-Hello-Worldテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol