不管你学哪一门计算机语言,很多时候你编写的第一个程序都会是HelloWorld!
当我们第一次写的代码能在屏幕上输出”HelloWorld!“时,我相信我们的心情是无比激动的。
汇编语言:
data segment
string db 'HelloWorld'
org 100h
data ends
code segment
assume cs:code,ds:data
begin:mov ax,data
move ds,ax
lea dx,string
mov bl,01h
mov ah,09
int 21h
mov ah,4ch
int 21h
code ends
end begin
C语言:
#include <stdio.h>
#include <windows.h>
int main() {
printf("hello world!\n");
system("pause");
return 0;
}
C++语言:
#include<iostream>
using namespace std;
int main()
{
cout<<"HELLO WORLD"<<endl;
return 0;
}
java语言:
public class HelloWorld{
public static void main(String[] args){
System.out.println("HelloWorld");
}
Python语言:
print('Hello World!')
以上是我使用过的语言,请用你使用过的语言在下面留言!!
本文分享了多种编程语言下的HelloWorld程序实现,包括汇编、C、C++、Java和Python等,适合编程初学者体验不同语言的魅力。

1976

被折叠的 条评论
为什么被折叠?



