hello, world”程序是指在电脑屏幕上打印/输出”hello, world”这行字符串的应用程序。该范例最早出自1972年由贝尔实验室成员布莱恩柯林汉撰写的内部技术档案”A Tutorial Introduction to the Language B”中,排名按语言火热程度
1. Java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world!");
}
}
2. C
#include<stdio.h>
int main(void) {
printf("hello, world!");
return 0;
}
3. C++
#include <iostream>
int main() {
using namespace std;
cout << "hello, world!";
return 0;
}
4. Python
# -*- coding: UTF-8 -*-
print('hello, world!')
5. Visual Basic .Net
Module Hello
Sub Main()
MsgBox("Hello, World!")
End Sub
End Module
6. C#
public class HelloWorld {
public static void Main() {
System.Console.WriteLine("hello, world!");
}
}
7. Java