题解 | #包含数字9的数#

包含数字9的数

https://www.nowcoder.com/practice/0948f4f3344c452f843afd3585dd0f8d

#include<stdio.h>
int main()
{
	int count = 0;
	for (int i = 1; i <= 2019; i++)
	{
		if (i % 10 == 9 || i / 10 % 10 == 9 || i / 100 % 10 == 9)
		{
			count++; 
		}
	}
	printf("%d", count); 
}

全部评论

相关推荐

这是什么操作什么意思,这公司我服了...
斯派克spark:意思是有比你更便宜的牛马了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务