the goal is to find the least number that is greater than n and the digit sum of that number canbe fully divided by 11. and after I run it, it return nothing.
public class M1
{
public static int nextCRC(int n)
{
int crc;
for (crc=n+1;crc!=0;crc++)
{
int sum=0;
for (crc =n+1 ; crc!=0; crc = crc / 10)
{
int digit = crc % 10;
sum += digit;
if ( sum %11 == 0)
{
break;
}
}
}
return crc;
}
public static void main(String[] args)
{
M1 Model=new M1();
Model.nextCRC(20);
System.out.println(Model.nextCRC(20));
}
}