当前位置:网站首页>Zzuli:1061 sequential output of digits
Zzuli:1061 sequential output of digits
2022-07-02 05:29:00 【Don't explode】
Title Description
Enter a value not greater than 10 Of 9 A positive integer to the power , Start from the high bit, divide it bit by bit and output each digit .
Input
Enter a positive integer n,n yes int Type data
Output
Output the numbers in turn , Each number is followed by a space , Output takes up one line . for example , Input 12345 , Output 1 2 3 4 5
The sample input Copy
12345
Sample output Copy
1 2 3 4 5
Tips
Pay attention to integer operation and avoid using double Functions of type, such as pow().
This problem can first use a cycle to calculate the highest bit weight h, And then a loop , The content of the loop is : Output highest bit (n/h)、 Throw away the top (n = n%h)、 Lower the highest position (h = h/10), Until the right position h by 0.
#include <stdio.h>
int main ()
{ int n,a,h;
scanf("%d",&n);
a=n;
h=1;
while(a>9)
{
a/=10;
h*=10;
}
while(h>0)
{
printf("%d ",n/h);
n%=h;
h/=10;
}
return 0;
}边栏推荐
- Small and medium-sized projects to achieve certification and authorization of hand filter
- Collectors. Groupingby sort
- Ubuntu 20.04 installing mysql8
- Fabric. JS upload local image to canvas background
- 金融门户相关信息
- How matlab marks' a 'in the figure and how matlab marks points and solid points in the figure
- Fabric. JS gradient
- 黑马笔记---Map集合体系
- Paddlepaddle project source code
- Gee: remote sensing image composite and mosaic
猜你喜欢

Win10 copy files, save files... All need administrator permission, solution
![Gee: explore the characteristics of precipitation change in the Yellow River Basin in the past 10 years [pixel by pixel analysis]](/img/ff/59956c2323567cc614458a2bccb642.jpg)
Gee: explore the characteristics of precipitation change in the Yellow River Basin in the past 10 years [pixel by pixel analysis]

Paddlepaddle project source code
![Gee series: Unit 5 remote sensing image preprocessing [GEE grid preprocessing]](/img/1e/cf0aa09c2fce2278386f12eae4a6cd.jpg)
Gee series: Unit 5 remote sensing image preprocessing [GEE grid preprocessing]

Résumé de la collection de plug - ins couramment utilisée dans les outils de développement idea

Gee series: unit 6 building various remote sensing indexes in Google Earth engine

MySQL foundation --- query (learn MySQL foundation in 1 day)

青训营--数据库实操项目

Fabric. JS iText superscript and subscript

Gee series: Unit 2 explore datasets
随机推荐
paddle: ValueError:quality setting only supported for ‘jpeg‘ compression
Global and Chinese market of travel data recorder (VDR) 2022-2028: Research Report on technology, participants, trends, market size and share
中小型项目手撸过滤器实现认证与授权
"Original, excellent and vulgar" in operation and maintenance work
Fabric.js 圆形笔刷
7.1模擬賽總結
Using QA band and bit mask in Google Earth engine
Fabric.js IText 上标和下标
Black Horse Notes - - set Series Collection
Principle and implementation of parallax effect
Fabric. JS free draw rectangle
Mysql基础---查询(1天学会mysql基础)
Financial portal related information
函数栈帧的创建和销毁
Fabric. JS iText sets the color and background color of the specified text
Gee series: Unit 3 raster remote sensing image band characteristics and rendering visualization
Global and Chinese market of cell culture freezers 2022-2028: Research Report on technology, participants, trends, market size and share
Fabric.js IText 手动设置斜体
Gee: explore the change of water area in the North Canal basin over the past 30 years [year by year]
生成二维码