题解 | #包含数字9的数#
包含数字9的数
http://www.nowcoder.com/practice/0948f4f3344c452f843afd3585dd0f8d
//import java.util.Scanner; public class Main { public static void main(String[] args) { //Scanner sc = new Scanner(System.in); int ans=0; for(int i=1;i<=2019;i++) { if(i%10==9||i/10%10==9||i/100%10==9) { ans++; } } System.out.println(ans); } }