java:
public class helloworld{ public static void main(String []args) { System.out.println("Hello world!"); }}
print "Hello world!"
print ("Hello world!")
#include <stdio.h>int main(){ printf("Hello world!\n"); return 0;}
<?phpecho "Hello world!"?>
java:
public class helloworld{ public static void main(String []args) { System.out.println("Hello world!"); }}
python2:print "Hello world!"
python3:print ("Hello world!")
C/C++:#include <stdio.h>int main(){ printf("Hello world!\n"); return 0;}
Linux intel asm(由於知道不支援組合語言,因此可讀性會差一點):[section data]msg db "Hello world!", 0axlen equ $ - msg[section text]global _start_start: mov eax, 4 mov ebx, 1 mov ecx, msg mov edx, len int 0x80 mov eax, 1 mov ebx, 0 int 0x80Linux AT&T asm(由於知道不支援組合語言,因此可讀性會差一點):.datamsg: .ascii "Hello world!\n"len = . - msg.text.globl _start_start: movl $4, %eax movl $1, %ebx movl $msg, %ecx movl $len, %edx int $0x80 movl $1, %eax movl $0, %ebx int $0x80php:<?phpecho "Hello world!"?>