воскресенье, 18 ноября 2012 г.

Test code

 
    public class SyntaxHighlighterWorksFineHere
    {
        public static void main(String[] args)
        {
            System.out.println("Yes!");
        }
    }
Код на Python:
 
def f(): return 0
print "Hello World!"
Код на С++:
#include 
using namespace std;

int main()
{
 std::cout << "Welcome to the wonderful world of C++!!!\n";

 return 0;

}
Код на Perl:
#!/usr/bin/perl
#Writing to a file
use strict;
use warnings;

use Path::Class;
use autodie; # die if problem reading or writing a file

my $dir = dir("/tmp"); # /tmp

my $file = $dir->file("file.txt"); # /tmp/file.txt

# Get a file_handle (IO::File object) you can write to
my $file_handle = $file->openw();

my @list = ('a', 'list', 'of', 'lines');

foreach my $line ( @list ) {
    # Add the line to the file
    $file_handle->print($line . "\n");
}
Код на Ruby:
class HelloWorld
   def initialize(name)
      @name = name.capitalize
   end
   def sayHi
      puts "Hello #{@name}!"
   end
end

hello = HelloWorld.new("World")
hello.sayHi
Power Shell:
$i = 1
do {Write-Host $i; $i++}
while ($i -le 5)
Код на bash:
echo "Hello World!"