[有答案啦!!]盼各路高手帮忙分析一下
有答案了,帮忙看看对不对:
判断一个素数能被几个9整除
main() { long int m9=9,sum=9; int zi,n1=1,c9=1; scanf("%d",&zi); while(n1!=0) { if(!(sum%zi)) n1=0; else {m9=m9*10; sum=sum+m9; c9++; } } printf("%ld,can be divided by %d \"9\"",sum,c9); }
(盼能讲解,谢谢)