Skip to content

Instantly share code, notes, and snippets.

@yotamorimoto
Last active October 11, 2024 14:37
Show Gist options
  • Select an option

  • Save yotamorimoto/2274025 to your computer and use it in GitHub Desktop.

Select an option

Save yotamorimoto/2274025 to your computer and use it in GitHub Desktop.
プログラム実行
キーボードによるプログラムの実行方法は OS (macOS/Windows/Linux) によって違う
macOS cmd + return
Windows & Linux ctrl + return
下の行にカーソルを置き、実行する
1 + 2;
ポストウィンドウに計算結果が出力される
;(セミコロン)はプログラム中の改行を表す
実践
プログラムを書き実行する
加減乗除の演算子(+、ー、*、/)と数字を組合わせ、計算をする
1 + 1 / 2;
注:演算子に関わらす計算はいつも左から行われる
出力は 1 + 1 = 2
2 / 2 = 1
順序は () で変更
1 + (1 / 2) = 1.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment