package 蓝桥杯;
public class 门牌制作 {
public static void main(String[] args) {
int ans=0;
for (int i = 1; i <=4040 ; i++) {
String a=i+"";
for (int j = 0; j < a.length(); j++) {
if (a.charAt(j)=='2'){
ans++;
}
}
}
System.out.println(ans);
}
}
07-24
861
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)