UVa 10922 - 2 the 9s

Very simple stuff. Just don't misunderstand the problem. See the code /* temper3243@gmail.com */ /* temper3243@gmail.com */ int level(int k,int lv) {	int sum=0; if(k<=9) return lv; else {		while(k) {			sum+= k%10; k=k/10; }		if(sum>9) return (level(sum,lv+1)); else return lv+1; } } int main {	char s[1500]; int len=0,sum,count=0,i; while(scanf(" %s",s)!=-1) {		len=strlen(s); if(len==1 && *s=='0') break;
 * 1) include

sum=0;

for(i=0;i<len;i++) {			sum+=s[i]-'0'; }

if(sum % 9!=0) {			printf("%s is not a multiple of 9.\n",s); }		else {			count=level(sum,1); printf("%s is a multiple of 9 and has 9-degree %d.\n",s,count); }	}	return 0; }