You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
682 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
const int N = 20;
int pw[N];
typedef long long ll;
const int mod = 1e9 + 7;
int main() {
pw[0] = 1; // 10^0=1,递推的起点
// 1、一日取模终生取模~
// 2、为了防止运算过程中溢出所以在乘法时注意加上ll类型转换
// i ∈ [1,N-1] 共19位
for (int i = 1; i < N; i++) pw[i] = (ll)10 * pw[i - 1] % mod;
for (int i = 1; i < N; i++) printf("%d ", pw[i]);
/*
10 100 1000 10000 100000 1000000 10000000 100000000 1000000000 999999937 999999307 999993007 999930007 999300007 993000007 930000007 300000007 49 490
*/
return 0;
}