1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

paizaラーニング問題集「【計算 2】疑似乱数」を解いてみた

Posted at

▼考え方

題意の通りコーディングしました。

▼コード

########## 処理0(準備) インプット,変数定義 ###########

X,M,N = map(int,input().split())

# X_total: 疑似乱数の計算式のうちXの数列部分を格納する変数
X_total = 0

########## 処理1 疑似乱数の計算と出力 ###########

for i in range(1,N+1):
    X_total += X**i
    print(X_total%M)
1
0
0

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?