Differences between revisions 1 and 2
Revision 1 as of 2018-10-09 05:58:39
Size: 793
Comment:
Revision 2 as of 2018-10-09 06:29:30
Size: 1933
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
#acl AdminGroup:read,write,delete,revert,admin TadashiIijima:read,write,delete,revert,admin IijimaStaffGroup: IijimaGroup: IijimaObogGroup: GuestGroup: Known: All: #acl AdminGroup:read,write,delete,revert,admin TadashiIijima:read,write,delete,revert,admin IijimaStaffGroup: IijimaGroup: IijimaObogGroup: GuestGroup: Known: All:read
Line 19: Line 19:
import math
Line 20: Line 21:
print( math.gcd( 350, 450 ) )
Line 26: Line 28:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
# * Copyright (c) 2018 IIJIMA, Tadashi
# * (IIJIMA Laboratory, Dept. of Science and Technology, Keio University).
# ==============================================================================
# ソフトウェア工学[02] 例題[02]-(009a) Ex_02_009a_greatest_common_divisor_builtin.py
# Ex(Example) 02-009a: 【組込関数】 最大公約数 gcd ( greatest common divisor )の使い方.
# Python 3.3から導入された.
# 2018-10-03 飯島 正 (iijima@ae.keio.ac.jp)
# ==============================================================================
# ----- 数学関数を扱うためのmathモジュールをインポートする -----
import math
# ==============================================================================
# ===== 【メイン・プログラム】  =====
print( math.gcd( 350, 450 ) )
# ==============================================================================

例題(9)

   1 import math
   2 
   3 print( math.gcd( 350, 450 ) )
  • 例題ファイルとしては,コメントを付け加えた,下記を配布します.
    • コメントはもう少し増えるかもしれません.

   1 #!/usr/bin/env python
   2 # -*- coding: utf-8 -*-
   3 # ==============================================================================
   4 # * Copyright (c) 2018 IIJIMA, Tadashi
   5 # *       (IIJIMA Laboratory, Dept. of Science and Technology, Keio University).
   6 # ==============================================================================
   7 # ソフトウェア工学[02] 例題[02]-(009a)  Ex_02_009a_greatest_common_divisor_builtin.py
   8 # Ex(Example) 02-009a: 【組込関数】 最大公約数 gcd ( greatest common divisor )の使い方. 
   9 #                               Python 3.3から導入された.
  10 #        2018-10-03 飯島 正 (iijima@ae.keio.ac.jp)
  11 # ==============================================================================
  12 # ----- 数学関数を扱うためのmathモジュールをインポートする -----
  13 import math
  14 # ==============================================================================
  15 # ===== 【メイン・プログラム】  =====
  16 print( math.gcd( 350, 450 ) )
  17 # ==============================================================================


SoftEng: Python/Prog/Example/02/Ex_009a (last edited 2018-10-28 12:38:24 by TadashiIijima)