多种编程语言的“hello world!”写法

C
#include <stdio.h>
main()
{
printf ("Hello World!\n");
}
C++
#include <iostream.h>
main()
{
for(;;)
{
cout << "Hello World! ";
}}

C#
class HelloWorld
{
  static void Main () {
     System.Console.Write("Hello World!");
  }
}

PHP
<?php
echo "<html>
<head>
<title>Hello World Page</title>
</head>
<body>
Hello World!
</body>
</html>"
?>

HTML
<HTML>
<HEAD>
<TITLE>Hello, World Page!</TITLE>
</HEAD>
<BODY>
Hello, World!
</BODY>
</HTML>

Java
class HelloWorld {
        public static void main (String args[]) {
        for (;;) {
                 System.out.print("Hello World ");
                 }
        }
}

Perl
  print "Hello, World!\n" while (1);

Python
print "Hello world!"
Also an infinite loop:
while True:
  
 print "Hello world!"

Ruby
for i in 1..1
    puts "Hello World!"
end
感谢hello,world page!
阅读更多
版权声明:本文为博主原创文章,知识无界限,欢迎转载。 https://blog.csdn.net/jgy8421d13/article/details/50009989
个人分类: C开发
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭