hasOne

public boolean hasOne(int n) {
  int lastdigit=0;
  while( n >0 ){
    
    lastdigit=(n % 10);
    if(lastdigit==1) return true;
    n=n/10;
    
  }
  return false;
}

http://codingbat.com/prob/p191212

MySQL限时解答,24小时内友哥专业解答
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指
原文地址:https://www.cnblogs.com/youge-OneSQL/p/6403387.html