LoginSignup
0

More than 3 years have passed since last update.

プログラミングで数学と英語を学ぶ(その1)

Posted at

問題

使用する英単語

https://progeigo.org/learning/essential-words-600-plus/
のAから始まる単語

プログラム


#!/usr/bin/python3
# -*- coding: utf-8 -*-

# author : my page
# account : my page
# my favorite audio : anime song

import sys

# 割り算を許可した数字
allow_numer_list = [3,5]

if len(sys.argv) != 2 :
    # このアプリケーションの使用を受け入れるには、引数を1つ入力してください。
    print('To accept the usage of this application, input one argumet.')
    sys.exit(1)

try :
    # 適用する数字
    apply_number = int(sys.argv[1])

except :
    # この引数は利用可能な属性ではない
    print('This argument is not available attribute.')
    sys.exit(1)

# 入手する数字
access_number = 0
# 配列
array = range(1, apply_number)
for num in array :
    # 代替の数字?
    for alternative_num in allow_numer_list :
        # 回避しないアルゴリズム?
        # not avoid algorithm
        if num % alternative_num == 0:
            access_number += num
            break

print(access_number)

実行結果


# python3 test.py 1000
233168

結論

もっと英語勉強します。

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
0