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
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
转载于:https://www.cnblogs.com/youge-OneSQL/p/6403387.html