今天是2024年7月4日 第27周 星期四

代人,时大变了。

我们生活在大地上,但我们的梦想超越天空。

“Hello world”的版本间的差异

来自Akarin
跳到导航 跳到搜索
 
(未显示3个用户的4个中间版本)
第1行: 第1行:
 
'''Hello world'''为一梗,于程序员中流传,源于《Introduction to the Language B》一书示例程序之首,后用于入门编程语言的第一个程序。
 
'''Hello world'''为一梗,于程序员中流传,源于《Introduction to the Language B》一书示例程序之首,后用于入门编程语言的第一个程序。
  
== 各类代码实现 ==
+
==各类代码实现==
<br />
+
 
 +
===ABAP===
 +
<source lang="abap">
 +
REPORT Z_AKARIN_HELLO.
 +
WRITE 'Hello world!'.
 +
</source>
 +
===C===
 +
<source lang="c">
 +
#include<stdio.h>
 +
int main(){
 +
   printf("Hello world!");
 +
}
 +
</source>
 +
===C++===
 +
<source lang="cpp">
 +
#include<iostream>
 +
int main(){
 +
   std::cout<<"Hello world!";
 +
}
 +
</source>
 +
===Python===
 +
<source lang="py">
 +
print("Hello world!")
 +
</source>
 +
<source lang="py">
 +
import __hello__
 +
</source>
 +
===Lua===
 +
{{Seealso|Module:Example}}
 +
===Wenyan===
 +
<source>
 +
吾有一言。曰「「問天地好在。」」。書之。
 +
</source>

2020年7月19日 (日) 13:26的最新版本

Hello world为一梗,于程序员中流传,源于《Introduction to the Language B》一书示例程序之首,后用于入门编程语言的第一个程序。

各类代码实现

ABAP

<source lang="abap"> REPORT Z_AKARIN_HELLO. WRITE 'Hello world!'. </source>

C

<source lang="c">

  1. include<stdio.h>

int main(){

   printf("Hello world!");

} </source>

C++

<source lang="cpp">

  1. include<iostream>

int main(){

   std::cout<<"Hello world!";

} </source>

Python

<source lang="py"> print("Hello world!") </source> <source lang="py"> import __hello__ </source>

Lua

Wenyan

<source> 吾有一言。曰「「問天地好在。」」。書之。 </source>