Skip to main content

HelloWorld

Python

py
#!/usr/bin/env python

print('hello')

Swift

swift
#!/usr/bin/env swift

print("hello")

PHP

php
#!/usr/bin/env php
<?php
print("hello\n");
?>

?> は、無くても良い。 というより、ないのが推奨なのだとか

TypeScript

ts
console.log('hello')

Bash

bash
#!/bin/bash

echo 'hello'

Ruby

rb
#!/usr/bin/env ruby

puts('hello')

PowerShell

echo 'hello'

C++

cpp
#include <iostream>

using namespace std;

int main() {
cout << "hello" << endl;
return 0;
}

C#

cs
Console.WriteLine("hello");

Kotlin

kt
fun main(args:Array<String>) {
println("sample")
}