当前位置:网站首页>Doorplate making C language
Doorplate making C language
2022-07-02 23:08:00 【Large dish color】
House number making
Xiaolan wants to make house numbers for the residents in a street .
This street has 2020 Residents , House number from 1 To 2020 Number .
Xiaolan's method of making house number is to make it first 0 To 9 These numeric characters , Finally, paste the characters on the doorplate as needed , For example, the house number 1017 You need to paste the characters in turn 1、0、1、7, That is to say 1 Characters 0,2 Characters 1,1 Characters 7.
Please make all the 1 To 2020 House number , How many characters are needed in total 2?
Code :
#include<stdio.h>
int main()
{
int i,j,temp,count=0,a;
for(i=1;i<=2020;i++)
{
temp=i;
while(temp!=0)
{
a=temp%10; // Take the last digit of the number
if(a==2)
count++;
temp=temp/10; // Remove the last digit of the number
}
}
printf("%d",count);
return 0;
} 边栏推荐
- Successfully changed Splunk default URL root path
- Jerry's built-in shutdown current is 1.2ua, and then it can't be turned on by long pressing [chapter]
- [leetcode] number of palindromes [9]
- 设置单击右键可以选择用VS Code打开文件
- World Environment Day | Chow Tai Fook serves wholeheartedly to promote carbon reduction and environmental protection
- LeetCode 968. 监控二叉树
- Qt QScrollArea
- Jerry's charge unplugged, unable to touch the boot [chapter]
- Redis 过期策略+conf 记录
- 分布式监控系统zabbix
猜你喜欢

Minimum spanning tree

Qt QSplitter拆分器

Lambda expression: an article takes you through

QT qpprogressbar details

Methods to solve the tampering of Chrome browser and edeg browser homepage
![[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM](/img/5d/c23ec16df6ce8d78207b635f59dc20.png)
[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM
![The kth largest element in the [leetcode] array [215]](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
The kth largest element in the [leetcode] array [215]

Splunk audit 的设定
![[adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)](/img/a3/d8421ea1539eba08bf7a5a629d92e6.jpg)
[adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)

归并排序详解及应用
随机推荐
Motivation du Protocole de chiffrement avancé AES
2016. maximum difference between incremental elements
Brief introduction of emotional dialogue recognition and generation
How does Jerry test the wrong touch rate of keys [chapter]
[NPUCTF2020]ezlogin xPATH注入
门牌制作 C语言
实现BottomNavigationView和Navigation联动
xshell配置xforward转发火狐浏览器
Chow-Liu Tree
LC173. 二叉搜索树迭代器
`Usage of ${}`
Sword finger offer II 099 Sum of minimum paths - double hundred code
Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月1日08:43:06
情感对话识别与生成简述
Freshman learning sharing
Jericho's thimble reaction when directly touching the prototype is abnormal [chapter]
密码技术---分组密码的模式
[adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)
Go language sqlx library operation SQLite3 database addition, deletion, modification and query
Webrtc audio and video capture and playback examples and mediastream media stream analysis