美文网首页
各语言的Hello World!

各语言的Hello World!

作者: 多多小姐姐 | 来源:发表于2019-01-02 19:21 被阅读0次

    我的第一个 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!" << endl;

                return 0;

    }

    编译/执行 C 程序

    #include <stdio.h> 

    int main(){ 

              /* 我的第一个 C 程序 */

              printf("Hello, World! \n");

               return 0;

    }

    执行Python程序

    #!/usr/bin/python3 

    print("Hello, World!")

    通过实例学习 PHP

    <!DOCTYPE html>

    <html>

    <body>

    <?php

    echo "Hello World!";

    ?>

    </body>

    </html>

    编译/执行 Ruby 程序

    #!/usr/bin/ruby 

    puts "Hello World!";

    第一个 Perl 程序

    #!/usr/bin/perl

     print "Hello, World!\n";

    第一个 JSP 程序

    <html> 

            <head> 

                             <title>第一个 JSP 程序</title> 

            </head>

            <body> 

                         <%

                                        out.println("Hello World!"); 

                          %>

            </body>

    </html>

    第一个 Lua 程序

    print("Hello World!")

    第一个 Scala 程序

    object HelloWorld {

            def main(args: Array[String]): Unit = {

                    println("Hello, world!")

             }

    }

    第一个 Go 程序

    package main

    import "fmt"

    func main() {

            fmt.Println("Hello, World!")

    }

    相关文章

      网友评论

          本文标题:各语言的Hello World!

          本文链接:https://www.haomeiwen.com/subject/djltrqtx.html