73
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

酒が飲めるワンライン

Last updated at Posted at 2019-02-15

perl (5.18.2 で確認)

perl -E 'say"$_月は横浜で酒が飲めるぞ"for(1..12)'

ruby

ruby -e '12.times{|i|puts"#{i+1}月は横浜で酒が飲めるぞ"}'

bash

echo -e {1..12}月は横浜で酒が飲めるぞ"\n"

python3 (3.7.2 で確認)

python3 -c 'for n in range(1, 13): print(f"{n}月は横浜で酒が飲めるぞ")'

emacs-lisp (GNU Emacs 26.1 で確認)

(require 'cl)(let ((x 0))(while (< x 12) (cl-incf x)(insert (format "%d月は横浜で酒が飲めるぞ\n" x))))

php (PHP 5.6.30 で確認)

php -r 'for($i=1;$i<13;$i++){echo $i."月は横浜で酒が飲めるぞ\n";}'

Elixr (1.6.4 で確認)

elixir -e "1..12 |> Enum.map(&(\"#{&1}月は横浜で酒が飲めるぞ\n\")) |> IO.puts"

MySQL版 (MySQL 8 で確認)

CREATE DATABASE s;CREATE TABLE s.y (m int auto_increment, PRIMARY KEY (`m`));INSERT INTO s.y value (),(),(),(),(),(),(),(),(),(),(),();SELECT CONCAT(m, '月は横浜で酒が飲めるぞ') FROM s.y;DROP DATABASE s;

PostgreSQL (9.3 で確認)

psql -c "WITH RECURSIVE seq(i) AS (SELECT 1 UNION ALL SELECT i + 1 FROM seq WHERE i < 12) SELECT i || '月は横浜で酒が飲めるぞ' FROM seq;"

JavaScript (node.js v10.14.2)

node -e "for(let i=1;i<13;i++)console.log(i+'月は横浜で酒が飲めるぞ')"

Haskell (ghc8.4.4)

ghc -e 'mapM_ (\n-> putStrLn $ show n ++ "月は横浜で酒が飲めるぞ") [1..12]' 

GAWK(GNU Awk 4.1.3)

gawk 'BEGIN{for(i=1;i<13;i++) print i"月は横浜で酒が飲めるぞ"}'

ジャバ (OpenJDK11)

echo "IntStream.range(1, 13).forEach(m -> printf(\"%d月は横浜で酒が飲めるぞ\n\", m));" | jshell PRINTING -
73
24
22

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
73
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?