Hello World

  2013-03-01 00:00:00 CST

  Jingwen Peng

  Misc

ScreenShot

第一篇必然是 Hello World!各种语言的 Hello World!

HTML

1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html>
	<head>
		<title>Hello World!</title>
	</head>
	<body>
		<h1>Hello World!</h1>
	</body>
</html>

JavaScript

1
console.log("Hello World!");

Ruby

1
2
3
#!/usr/bin/ruby

puts "Hello World!\n";

Swift

1
print("Hello World!")

Objective-C

1
2
3
4
5
6
#import <Foundation/Foundation.h>

int main(int argc, char *argv[]){
	NSLog("Hello World!");
	return 0;
}

Java

1
2
3
4
5
public class Hello {
	public static void main(String args[]) {
		System.out.println("Hello World!");
	}
}

C

1
2
3
4
5
6
#include <stdio.h>

int main(int argc, char *argv[]){
	printf("Hello World!\n");
	return 0;
}

C++

1
2
3
4
5
6
#include <iostream>

int main(int argc, char *argv[]){
	std::cout << "Hello World!" << std::endl;
	return 0;
}

Bash

1
2
3
#!/bin/bash

echo "Hello World!"

PHP

1
2
3
#!/usr/bin/php

<?php echo "Hello World!"; ?>

Python

1
2
3
4
5
#!/usr/bin/python

def hello_world():
	print ("Hello World!")
hello_world()

Go

1
2
3
4
5
6
7
8
9
package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello Go!")
}

Perl

1
2
3
#!/usr/bin/perl

print "Hello World!\n";

如果您有疑问或建议,请在下方评论区域留言

遵循 BY-NC-ND 协议

评论功能加载中...