【C】#包含数字9的数#
包含数字9的数
https://www.nowcoder.com/practice/0948f4f3344c452f843afd3585dd0f8d
#include <stdio.h> int main() { int cnt = 0; for(int i = 1; i <= 2019; i++){ int tmp = i; while(tmp){ if(tmp % 10 == 9){ cnt++; break; } tmp /= 10; } } printf("%d", cnt); return 0; }