今天是2024年10月3日 第40周 星期四
代人,时大变了。
我们生活在大地上,但我们的梦想超越天空。
「Hello world」修訂間的差異
跳至導覽
跳至搜尋
小 (→各类代码实现) |
小 |
||
(未顯示由 1 位使用者於中間所作的 2 次修訂) | |||
行 4: | 行 4: | ||
===ABAP=== | ===ABAP=== | ||
+ | <source lang="abap"> | ||
REPORT Z_AKARIN_HELLO. | REPORT Z_AKARIN_HELLO. | ||
− | + | WRITE 'Hello world!'. | |
− | + | </source> | |
− | + | ===C=== | |
− | === Python === | + | <source lang="c"> |
− | print ("Hello | + | #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">
- 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
Wenyan
<source> 吾有一言。曰「「問天地好在。」」。書之。 </source>