题解 | #包含数字9的数#
包含数字9的数
https://www.nowcoder.com/practice/0948f4f3344c452f843afd3585dd0f8d
#include <iostream>
using namespace std;
int main() {
int count=0;
for (int a = 1; a <= 2019; a++) {
int b=a;
while (b > 0) {
if (b % 10 == 9) {count++;break;}
else b = b / 10;
}
}
cout<<count;
return 0;
}
