最小限での関数の書き方
コード内容
1 2 3 |
関数を定義する。 関数を呼び出す。 |
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#include <iostream> int sample() { return 0; } int main() { sample(); return 0; } |
PHP
1 2 3 4 5 6 7 8 9 10 |
<?php function sample(){ return; } sample(); ?> |
JavaScript
1 2 3 4 5 6 7 8 9 10 |
<script> function sample() { return; } sample(); </script> |
Swift
1 2 3 4 5 6 |
func sample(){ return } sample() |