public int s(int num){ int max = 0; while(num>10){ int tmp = num % 10; if(tmp>max){ max = tmp; } num = num / 10; } return max;}