int fun(int w){ int sum = 0; while(w>0) { sum += (w%10) * (w%10); w/=10; } if(sum%6==0) return 1; return 0;}