#pragma warning(disable:4996)
#include<stdio.h>
int main()
{
int m = 0; //初始值
int n = 0; //终结值
int z = 0; //统计几个9
printf("请输入需要求9的区域:");
scanf("%d%d", &m, &n);
int i = m;
for (i = m;i <= n;i++)
{
if (i % 10 == 9)
{
z++;
printf("%d\n", i);
}
if (i / 10 == 9)
{
z++;
printf("%d\n", i);
}
}
printf("%d~%d一共有%d个9", m, n, z);
return 0;
}
纯纯干货啊兄弟们,麻烦支持,鼓励一下下啦
标签:纯纯,10,设定,内有,int,初始值,++,区域,printf From: https://blog.51cto.com/u_15880518/5875337