题解 | #包含数字9的数#
包含数字9的数
https://www.nowcoder.com/practice/0948f4f3344c452f843afd3585dd0f8d
public class Main { public static void main(String[] args) { int n=0; for (int i=1;i<=2019;i++){ String m=String.valueOf(i); boolean l=m.contains("9"); if (l){ n++; } } System.out.print(n); } }