1.问题描述
求13的13次方的最后三位数。
2.源码实现
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int a = 13;
int n = 13;
int s = 1;
int i;
for(i=0; i<n; i++)
{
s = a * s % 1000;
}
printf("%d\n", s);
return 0;
}
3.编译源码
$ gcc -o test test.c -std=c89
4.运行及其结果
./test
253
网友评论