“Hello world”的版本间的差异
RainbowDash(讨论 | 贡献) (创建页面,内容为“'''Hello world'''为一梗,于程序员中流传,源于《Introduction to the Language B》一书示例程序之首,后用于入门某语言的第一个程序”) |
小 |
||
| (未显示4个用户的6个中间版本) | |||
| 第1行: | 第1行: | ||
| − | '''Hello world'''为一梗,于程序员中流传,源于《Introduction to the Language B》一书示例程序之首,后用于入门 | + | '''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=== | ||
| + | {{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>