1.Java

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

2.C

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

3.Python

print('Hello World !')

4.C++

using namespace std;
int main ()
{
    cout << "\nHello World" << endl;
    return 0;
}

5.C#

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

6.Visual Basic .NET

Module HelloWorld
    Sub Main()
        System.Console.WriteLine("Hello World !")
    End Sub
End Module

7.JavaScript

console.log("Hello World !");

8.PHP

echo "Hello World !";

9.Objective-C

int main(int argc, const char * argv[]){
        @autoreleascepool{
            NSLog(@"Hello World !");
        }
        return 0;
}

10.SQL

SELECT 'Hello World !';
PRINT 'Hello World !';

11.Ruby

puts 'Hello World !';

12.MATLAB

fprint(1,'Hello World !');
quit
最后修改:2020 年 10 月 21 日 02 : 00 PM
如果觉得我的文章对你有用,请随意赞赏