HDU 1163 Eddy's digital Roots

http://acm.hdu.edu.cn/showproblem.php?pid=1163

脑袋疼的厉害,写完没调试直接交,居然把%d写成%c,导致wa一次。。。

这题感觉前两天刚做过一道一样的。。。HDOJ的题目很多无脑重复啊。。

View Code
#include <stdio.h>

int main()
{
    int n;
    int i,s;
    while(scanf("%d",&n),n)
    {
        s=1;
        for(i=0;i<n;i++)
            s=s*n%9;
        if(s==0)
            printf("9\n");
        else
            printf("%d\n",s);
    }
    return 0;
} 
原文地址:https://www.cnblogs.com/xiaohongmao/p/2465068.html