多种语言输出helloworld,看懂五种是入门全懂就是大神

Hello,World,几乎是程序猿学习各种语言的第一个程序,如果你说你不知道hello world,我觉得你就没有必要点进来了,下面是用各种编程语言输出hello world,你都认识吗?

下面给出源码,和图片格式的源码,方便大家复制和浏览。

第一种方式,java

public class HelloWorld{

public static void main(String[] args){

System.out.println("Hello,World!");

}

}

多种语言输出helloworld,看懂五种是入门全懂就是大神

java

第二种方式,C语言

#include

int main()

{

printf("Hello,World!");

return 1;

}

多种语言输出helloworld,看懂五种是入门全懂就是大神

C语言

第三种,c++

#include

#include

int main()

{

printf("Hello,World!--Way 1\n");

puts("Hello,World!--Way 2");

puts("Hello," " " "World!--Way 3");

std::cout << "Hello,World!--Way 4"

return 1;

}

多种语言输出helloworld,看懂五种是入门全懂就是大神

c++

第四种语言python

>>>> print "Hello,World!" #Python 2.x

Hello,World!

>>> print("Hello,World!") #Python 3.x

Hello,World!

多种语言输出helloworld,看懂五种是入门全懂就是大神

python

第五种语言,C#

using System;

class TestApp

{

public static void Main()

{

Console.WriteLine("Hello,World!");

Console.ReadKey();

}

}

多种语言输出helloworld,看懂五种是入门全懂就是大神

c#

第六种,php

echo "Hello,World!"; //打印语句

echo "The first php program!"; //打印语句

echo phpinfo(); //phpinfo()系统函数,输出环境信息

?>


分享到:


相關文章: