1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 08:26:20 +00:00
202401-programming-assignments/【实践课外】6.循环结构3/7-5 21循环-求和3.c

22 lines
313 B
C

#include <stdio.h>
int main() {
int n, k, ans = 0;
scanf("%d%d", &n, &k);
for (int i = 1; i <= n; i++) {
int tmp = 1;
for (int j = 1; j <= k; j++) {
tmp = tmp * i % 114514;
}
ans = (ans + tmp) % 114514;
}
printf("%d\n", ans);
return 0;
}