我见过的几门语言中的hello world
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了我见过的几门语言中的hello world相关的知识,希望对你有一定的参考价值。
1.Java
public class hello {
public static void main(String[] args){
System.out.println("hello world!");
}
}
2.C
#include<stdio.h> int main(void) { printf("hello world!"); return 0; }
3.C++
#include<stdio.h> int main(void) { printf("hello world!"); return 0; }
4.C#
using System; namespace hello { class Program { static void Main(string[] args) { Console.WriteLine("Hello,world!"); Console.ReadKey(); } } }
5.python
print ‘Hello World!‘
6.JS
<html> <body> <script type="text/javascript"> document.write("Hello World!"); </script> </body> </html>
7.php
<html>
<body>
<?php
echo "hello, world!";
?>
</body>
</html>
9.VB.NET
Sub Main() Console.WriteLine("Hello world!") Console.ReadKey() End Sub
10.perl
#!C:\Perl\bin print "Hello World!";
11.OC
#import <Foundation/Foundation.h> int main() { NSLog(@"Hello World!"); return 0; }
12.Ruby
puts "Hello world!"
13.vb
Private Sub Form_Load() msbbox ("hello world!") End Sub
14.Delphi
procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption := ‘Hello World!‘; end;
15.Pascal
Program HelloWorld(output);
begin
writeln(‘Hello, world!‘)
end.
16.Go
package main
import "fmt"
func main() {
fmt.Printf("hello world!")
}
17.R
print("Hello,World!")
18.SQL
SQL> select ‘Hello World!‘ from dual;
19.HTML
<html> <body> Hello World! </body> </html>
20.Lua
print"hello world!"
以上是关于我见过的几门语言中的hello world的主要内容,如果未能解决你的问题,请参考以下文章
文末送书|豆瓣9.4分,“hello,world”起源于这本书!