About this site

In here we will discuss some program language,like the server script language PHP,shell,Python,Ruby and so on.In addition to this like the browser script language  javascript,and the compile language C,C++,Obj-C,Java and so on.Perhaps it has many errors,but I want you can find it and tell us.Thanks.

Below is some code segments which was wrote by the top main language in the internet.All the segment’s result is output a string “Hello World” in one line.

A sample of PHP code:

1
2
3
4
<?php
   $a = 'Hello World' ;
   echo $a ;
?>

A sample of Shell code:

1
2
3
#!/bin/sh
a = "Hello World"
echo a

A sample of Python code:

1
2
3
4
# -*- coding: utf-8 -*-
import sys
a = "Hello World"
print a

A sample of Ruby code:

1
2
a = "Hello World"
puts a

A sample of JavaScript code:

1
2
3
4
5
<script type= "text/javascript" >
   function sayHelloWorld() {
     alert( "Hello World" );
   }
</script>

A sample of C code:

1
2
3
4
5
6
#include <stdio.h>
int main ( int argc, char **argv)
{
   printf ( "Hello World!" );
   return 1;
}

A sample of C++ code:

1
2
3
4
5
6
#include <iostream>
using namespace std;
int main ( int argc, char **argv)
{
   std::cout<< "Hello World" <<std::end1;
}

A sample of Obj-C code:

1
2
3
4
5
#import <Foundation/Foundation.h>
int main ( int argc, char **argv)
{
   NSLog(@ "Hello World" );
}

A sample of Java code:

1
2
3
4
5
public class HelloWorld {
   public static void main(String args[]) {
     System.out.println( "Hello World" );
   }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值