最简单求100以内有多少9的代码,快进来看看是不是和你想的一样

#define CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
int i, count = 0;
for (i = 1; i < 101; i++)
{
if (i % 10 == 9)
count++;
if (i / 10 == 9)
count++;
}
printf(“count = %d\n”, count);
system(“pause”);
return 0;
}
求关注

猜你喜欢

转载自blog.csdn.net/ZhangaZhaoLong/article/details/82847934