用多种语言书写 “ helloworld ”

最基本的C:

#include<stdio.h>
int main(int argc, char const *argv[])
{
	printf("HelloWorld\n");
	return 0;
}

6行

C++:

#include<iostream>
int main(int argc, char const *argv[])
{
	std::cout<<"HelloWorld\n";
	return 0;
}

 6行

 Python:

print(" HelloWorld ")

1行

 Java:

public class TestJava {
	public static void main(String[] args) {
		System.out.println("HelloWorld");
	}
}

4行,但是类太多,更麻烦。

php:

<?
    each "HelloWorld";
?>

 

 Ruby:

puts "HelloWorld"

1行

Go:

package main
import "fmt"
func main(){
    fmt.Printf("HelloWorld");
}

 5行,功能强大,但是用的有点别扭。

Html:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>This is a simple html made by ST3</title>
	
</head>
<body>
    helloworld
</body>
</html>

Javascript:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>This is a simple html made by ST3</title>
	<script type="text/javascript">
		document.write("Hello World!");
	</script>
</head>
<body>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/qq_41684261/article/details/82749376