Hello World ,中文意思:你好,世界。世界上的第一个程序就是Hello World,由Brian Kernighan创作。
中文名:你好,世界。 外文名: Hello,World. 创造者: Brian Kernighan。
简介 :
“Hello, world"程序是指在计算机屏幕上输出“Hello,world”这行字符串的计算机程序,“hello, world”的中文意思是“世界,你好”。这个例程在Brian Kernighan 和Dennis M. Ritchie合著的《The C Programme Language》使用而广泛流行。因为它的简洁,实用,并包含了一个该版本的C程序首次出现在1974年Brian Kernighan所撰写的《Programming in C: A Tutorial》。
printf("hello, world\n");
实际上将“Hello”和“World”一起使用的程序最早出现于1972年,出现在贝尔实验室成员Brian Kernighan撰写的内部技术文件《Introduction to the Language B》之中:
main(){ extern a,b,c; putchar(a);putchar(b);putchar(c);putchar('!*n'); } a'hell'; b'o,w'; c'orld';
最初的"hello, world"打印内容有个标准,即全小写,有逗号,逗号后空一格,且无感叹号。不过沿用至今,完全遵循传统标准形式的反而很少出现。
各种语言的 hello,world :
VB
Module MainFrm Sub Main() System.Console.WriteLine("hello, world") End Sub End Module
C
#include <stdio.h> int main() { printf("hello, world"); return 0; }
BATCH
@echo off echo hello world pause
Java
public class HelloWorld { public static void main(String args[]) { System.out.println( "Hello World! \n" ); } }
C++
#include <iostream> using namespace std; int main() { cout<<"hello, world"<<flush; return 0; }
C#
namespace HelloWorld { class Program { static void Main(string[] args) { System.Console.Write("Hello World"); } } }
PHP
echo "hello, world"; JavaScript console.log("hello, world") Python 3 print("hello, world")
LaTeX
\documentclass{article} \begin{document} Hello world! \end{document}
Mathematica
方法一:基于Wolfram 底层语言(进入表达式界面使用):
Cell["Hello, World!"]
方法二:直接使用数学输出函数:
CellPrint[Cell["Hello, World!"]]
—— [ 文章最后编辑于:2017/02/20 ]