首页 不同编程语言实现HelloWorld程序
文章
取消

不同编程语言实现HelloWorld程序

C

1
2
3
4
5
6
7
#include <stdio.h>

int main()
{
      printf("Hello World!");
      return 0;
}

C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloWorld
{
      class Program
      {
            static void Main(string[] args)
            {
                  Console.WriteLine("Hello World!");
            }
      }
}

C++

1
2
3
4
5
6
7
#include <iostream>

int main()
{
      std::cout << "Hello World!" << std::endl;
      return 0;
}

HTML

1
2
3
4
5
6
7
8
9
10
<!doctype html>
<html>
      <head>
            <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
            <title>Hello World!</title>
      </head>
      <body>
            <h1>Hello World!</h1>
      </body>
</html>

Java

1
2
3
4
5
class HelloWorld{
    public static void main(String[] arr){
          System.out.println("Hello World!");
    }
}

Python

1
print "Hello World!"
本文由作者按照 CC BY 4.0 进行授权

C++中i++和++i的区别

在Github上建立自己的个人主页