1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】6.循环结构3/7-5 21循环-求和3.c

22 lines
313 B
C
Raw Normal View History

2024-11-02 12:58:43 +00:00
#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;
}