当前位置首页 > 百科> 正文

hello world(代码)

2019-09-01 08:54:17 百科
hello world(代码)

hello world(代码)

Hello World 中文意思是『你好,世界』。因为《The C Programming Language》中使用它做为第一个演示程式,非常着名,所以后来的程式设计师在学习编程或进行设备调试时延续了这一习惯。

基本介绍

  • 中文名:你好,世界
  • 外文名: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!")

GBasic

print("Hello, world!")

VB

Module MainFrm    Sub Main()        System.Console.WriteLine("Hello, World!")    End SubEnd Module

C

#include <stdio.h>int main(){    printf("Hello, World!");    return 0;}

Swift

print("Hello, World!")

Go

package mainfunc main() {    println("Hello, World!")}

BATCH

@echo offecho Hello, World!pause

Java

public class HelloWorld{    public static void main(String[] args){       System.out.println( "Hello, World!" );    }}

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!";

ASP

response.write ("Hello, World!")

JavaScript

console.log("Hello, World!")

Python 2

print "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!"]]

Ruby

def hello()      return "Hello , World"    end  

Free pascal

writeln('Hello, world!');

Kotlin

fun main(args: Array<String>) {    println("Hello, world!")}

MATLAB

disp('Hello, world!')

R

print('hello word!')
[1] "hello word!"
声明:此文信息来源于网络,登载此文只为提供信息参考,并不用于任何商业目的。如有侵权,请及时联系我们:baisebaisebaise@yeah.net