# include <iostream>
# include <cstdio>
# include <algorithm>
using namespace std;
int main(){
int n,a[10009];
int i,t;
while(scanf("%d",&n),n!=0){
int t = 1;
for(i=0;i<n;i++){
t=(n*t-1)%9+1;//-1的目的当时9的时候,输出9
}
printf("%d\n",t);
}
return 0;
}
杭电1163--9余项定理的例子
最新推荐文章于 2022-02-24 10:46:23 发布