Hello World được viết trên các ngôn ngữ, công cụ, thư viện lập trình khác nhau như thế nào ? | VN-Zoom | Cộng đồng Chia Sẻ Kiến Thức Công Nghệ và Phần Mềm Máy Tính

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We need money to operate the site, and almost all of it comes from our online advertising.

If possible, please support us by clicking on the advertisements.

Please add vn-z.vn to your ad blocking whitelist or disable your adblocking software.

×

Hello World được viết trên các ngôn ngữ, công cụ, thư viện lập trình khác nhau như thế nào ?

Administrator

Administrator

20708385_1581202895263750_3489414718466527587_n.jpg

Hello World phiên bản đời thực
"Hello World" một chương trình đơn giản , nổi tiếng nhất mà hầu như tất cả mọi lập trình viên bắt đầu làm quen với các ngôn ngữ lập trình khác nhau đều từng ít nhất 01 lần viết đoạn code cho chương trình này. Theo truyền thống thì đây là chương trình đầu tiên mà các developer kiểm tra hệ thống của họ. Đối với lập trình viên, khi họ nhìn thấy hai từ " hello world" hiện lên màn hình tức là các đoạn mã của họ có thể load, run , output ...

Hello-World-tieng-viet.jpg

Hello World bằng Tiếng Việt
Trong bài viết này, mình sẽ giới thiệu cách mà các lập trình viên viết chương trình "Hello World" bằng
892 ngôn ngữ lập trình khác nhau. Các bạn có thể hình dung sự phức tạp, đơn giản hay so sánh cú pháp của từng ngôn ngữ qua chương trình này.

Một số minh họa

1. Lập trình bằng C

Mã:
#include
int main(void)
{
puts(“Hello, world!”);
}


2. C++
Mã:
#include
int main()
{
std::cout << “Hello, world!”;
return 0;
}
3. C#
Mã:
using System;
class Program
{
public static void Main(string[] args)
{
Console.WriteLine(“Hello, world!”);
}
}
4. Java
Mã:
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}
phức tạp hơn thì viết

Mã:
import javax.swing.JFrame; //Importing class JFrame
import javax.swing.JLabel; //Importing class JLabel
public class HelloWorld {
public static void main(String[] args) {
JFrame frame = new JFrame(); //Creating frame
frame.setTitle(“Hi!”); //Setting title frame
frame.add(new JLabel(“Hello, world!”));//Adding text to frame
frame.pack(); //Setting size to smallest
frame.setLocationRelativeTo(null); //Centering frame
frame.setVisible(true); //Showing frame
}
}
5. JavaScript
Mã:
document.write(‘Hello, world!’);
6.Python
Mã:
print “Hello, world!”
7. Pascal
Mã:
program HelloWorld;
begin
WriteLn(‘Hello, world!’);
end.
8. Ruby
Mã:
puts “Hello, world!”
9. Visual Basic .NET
Mã:
Module Module1
Sub Main()
Console.WriteLine(“Hello, world!”)
End Sub
End Module
10. MatLab
Mã:
disp (‘Hello, world!’)
11. Swift

println(“Hello, world!”)

12.

13. Bash


echo “Hello World”

14. Perl 5

print “Hello, world!”;

15. Basic

PRINT “Hello, world!”

16. Objective-C

#import
#import
int main(void)
{
NSLog(@”Hello, world!”);
return 0;
}

17. XSLT

Hello World

18. CoffeeScript

console.log ‘Hello, world!’

19. Logo
Mã:
print [Hello, world!]
[code]
[B]20. VBScript[/B]
[code]
MsgBox “Hello, World!”
21. Clipper

? “Hello World”

22. Delphi
Mã:
program HelloWorld;
begin
Writeln(‘Hello, world!’);
end.

23. Julia
Mã:
println(“Hello world!”)

24. Processing

Mã:
  void setup()

  {
  println(“Hello, world!”);
  }

25. R

Mã:
cat(‘Hello, world!’)

26. PHP

Mã:
<?php
   echo "Hello World";
?>

27. HTML

Mã:
Hello World

Languages (892 total)​


Chi Tiết 892 ngôn ngữ tham khảo thêm tại

 

Bringlove

Gà con
Mình nhớ java chỉ là:
public static void main(String[] args)
{
System.out.println("Hello, World!");
}
}
 


Top