c语言数据统计时间:2022-11-13 20:00:24 #include<stdio.h>int main(){int count=0;int n, k,i;scanf("%d %d", &n, &k);for (i = n; i <= k; i++) {int j=i;while(j>0) {if (j % 10 == 2) //取余 {count++; }j = j / 10; //移动到前一位 } }printf("%d\n", count);return 0;}