今天是2025年12月16日 第51周 星期二
代人,时大变了。
我们生活在大地上,但我们的梦想超越天空。
“Hello world”的版本间的差异
跳到导航
跳到搜索
(→Python) 标签:移动网页编辑 移动版编辑 |
小 |
||
| (未显示另一用户的1个中间版本) | |||
| 第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(){ | |
| − | == Lua === | + | 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}} | {{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>