hello world

1
2
3
4
5
6
7
8
9
10
#FileName: HelloWorld.java  
public class HelloWorld #如果有 public 类的话,类名必须和文件同名,注意大小写
{
#Java 入口程序,程序从此入口
public static void main(String[] args)
{
#向控制台打印一条语句
System.out.println("Hello,World!");
}
}
1
2
3
4
5
6
#include <stdio.h>  
int main() #main 入口函数
{
printf("Hello,World!"); #printf 函数打印
return 1; #函数返回值
}
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>               //std::cout 要用到的头文件  
#include <stdio.h> //标准输入输出头文件

int main()
{
printf("Hello,World!--Way 1\n"); //printf 语句打印
puts("Hello,World!--Way 2"); //puts 语句
puts("Hello," " " "World!--Way 3"); //字符串拼接
std::cout << "Hello,World!--Way 4" << std::endl; //C++ 教科书上写法
return 1; //作为注释
}
1
print("Hello,World!")
1
2
3
4
5
6
7
8
9
<!DOCTYPE html>  
<body>
<?php
echo "Hello,World!"; //打印语句
echo "The first php program!"; //打印语句
echo phpinfo(); //phpinfo()系统函数,输出环境信息
?>
</body>
</html>
1
sys.puts("Hello,World!");
1
select 'Hello,World!' from dual;  
1
2
3
4
5
6
7
<!DOCTYPE html>  
<html>
<body>
<h1>This is the first program!</h1>
<p>Hello,World!</p>
</body>
</html>