三十种编程语言庆祝【国庆节】!!!
30种编程语言来打印“国庆节快乐”:
分别为:
- Python
- JavaScript
- Java
- C
- C++
- C#
- PHP
- Ruby
- Swift
- Go
- Rust
- Kotlin
- Scala
- Perl
- R
- Lua
- Dart
- TypeScript
- Bash (Shell)
- F#
- Julia
- Elixir
- Haskell
- Groovy
- Visual Basic .NET
- MATLAB
- PowerShell
- SQL
- VBA (Visual Basic for Applications)
- COBOL
这些语言覆盖了多种编程范式和应用场景,从脚本语言到系统级编程语言,以及用于特定领域的语言。
- Python
print("国庆节快乐")
- JavaScript
console.log("国庆节快乐");
- Java
public class Main {
public static void main(String[] args) {
System.out.println("国庆节快乐");
}
}
- C
#include <stdio.h>
int main() {
printf("国庆节快乐\n");
return 0;
}
- C++
#include <iostream>
int main() {
std::cout << "国庆节快乐" << std::endl;
return 0;
}
- C#
using System;
class Program {
static void Main() {
Console.WriteLine("国庆节快乐");
}
}
- PHP
<?php
echo "国庆节快乐";
?>
- Ruby
puts "国庆节快乐"
- Swift
import Swift
print("国庆节快乐")
- Go
package main
import "fmt"
func main() {
fmt.Println("国庆节快乐")
}
- Rust
fn main() {
println!("国庆节快乐");
}
- Kotlin
fun main() {
println("国庆节快乐")
}
- Scala
object HelloWorld extends App {
println("国庆节快乐")
}
- Perl
print "国庆节快乐\n";
- R
cat("国庆节快乐\n")
- Lua
print("国庆节快乐")
- Dart
void main() {
print("国庆节快乐");
}
- TypeScript
console.log("国庆节快乐");
- Bash (Shell)
echo "国庆节快乐"
- F#
printfn "国庆节快乐"
- Julia
println("国庆节快乐")
- Elixir
IO.puts "国庆节快乐"
- Haskell
main = putStrLn "国庆节快乐"
- Groovy
println "国庆节快乐"
- Visual Basic .NET
Module Module1
Sub Main()
Console.WriteLine("国庆节快乐")
End Sub
End Module
- MATLAB
disp('国庆节快乐')
- PowerShell
Write-Host "国庆节快乐"
- SQL (在SQL中,这通常是在查询结果中显示文本)
SELECT '国庆节快乐' AS Message;
- VBA (Visual Basic for Applications, 例如在Excel宏中)
Sub PrintMessage()
Debug.Print "国庆节快乐"
End Sub
- COBOL
IDENTIFICATION DIVISION.
PROGRAM-ID. Hello-World.
PROCEDURE DIVISION.
DISPLAY '国庆节快乐'.
STOP RUN.
每一种语言都有其特有的语法和方式来输出文本到控制台。那么?
有你会的那一种么?
原文地址:https://blog.csdn.net/pitaya_huatu/article/details/142422234
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!