本文主要是介绍2023年TIOBE指数TOP50的编程语言写“Hello World!”,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
这篇文章列出了TIOBE指数TOP50的编程语言(TIOBE Index - TIOBE)如何写“Hello World!”。“Hello World!”代码应该是每个程序员学习一门编程语言最先实现的程序,给我们带来了很多美好的回忆,下面我们就一次过足瘾,看看如何使用2023年TIOBE指数TOP50的编程语言写“Hello World!”。
Python
print("Hello World")
C
#include <stdio.h>
int main() {printf("Hello World");return 0;
}
C++
#include <iostream>
int main() {std::cout << "Hello World";return 0;
}
Java
public class HelloWorld {public static void main(String[] args) {System.out.println("Hello World");}
}
C#
using System;
class Program {static void Main(string[] args) {Console.WriteLine("Hello World");}
}
JavaScript
console.log("Hello World");
PHP
<?php echo "Hello World"; ?>
Visual Basic
Module Module1Sub Main()Console.WriteLine("Hello World")End Sub
End Module
SQL
SELECT 'Hello World';
Assembly
section .text
global _start_start:mov edx, len ;message lengthmov ecx, msg ;message to writemov ebx, 1 ;file descriptor (stdout)mov eax, 4 ;system call for sys_writeint 0x80 ;call kernelmov eax, 1 ;system call for sys_exitint 0x80 ;call kernelsection .data
msg db 'Hello, world!',0xa ;our dear string
len equ $ - msg ;length of our dear string
Scratch
"say" block with "Hello World"
Fortran
program hello
print *, 'Hello World'
end program hello
Go
package main
import "fmt"
func main() {fmt.Println("Hello World")
}
MATLAB
disp('Hello World')
Kotlin
fun main() {println("Hello World")
}
Delphi/Object Pascal
program HelloWorld;
beginWriteLn('Hello World');
end.
Swift
print("Hello World")
Rust
fn main() {println!("Hello World");
}
Ruby
puts "Hello World"
R
print("Hello World")
Prolog
:- initialization(main).
main :- write('Hello World'), nl.
D
import std.stdio;
void main() {writeln("Hello World");
}
COBOL
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.DISPLAY 'Hello World'.STOP RUN.
SAS
data _null_;
put 'Hello World';
run;
Classic Visual Basic (VB6)
Sub Main()MsgBox "Hello World"
End Sub
F#
printfn "Hello World"
(Visual) FoxPro
? "Hello World"
Ada
with Ada.Text_IO;
procedure Hello is
beginAda.Text_IO.Put_Line("Hello World");
end Hello;
Perl
print "Hello World\n";
VBScript
WScript.Echo "Hello World"
Dart
void main() {print('Hello World');
}
Julia
println("Hello World")
Transact-SQL
PRINT 'Hello World';
Objective-C
#import <Foundation/Foundation.h>
int main() {NSLog(@"Hello World");return 0;
}
Lua
print("Hello World")
Scala
object HelloWorld extends App {println("Hello World")
}
X++ (Used in Microsoft Dynamics AX)
static void Job1(Args _args)
{info("Hello World");
}
TypeScript
console.log("Hello World");
Lisp
(print "Hello World")
Haskell
main = putStrLn "Hello World"
ML (Standard ML)
print "Hello World\n";
Forth
." Hello World"
Scheme
(display "Hello World")
(newline)
ABAP
WRITE 'Hello World'.
Awk
BEGIN { print "Hello World" }
Logo
print [Hello World]
PL/SQL
BEGINDBMS_OUTPUT.PUT_LINE('Hello World');
END;
CFML (ColdFusion)
<cfoutput>Hello World</cfoutput>
PowerShell
Write-Host "Hello World"
ActionScript
trace("Hello World");
这篇关于2023年TIOBE指数TOP50的编程语言写“Hello World!”的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!