当前位置:网站首页>Reverse output an integer
Reverse output an integer
2022-06-26 01:49:00 【So it is^^】
thought : First %10 Find the last one and print it out , In addition 10 Remove the last digit , Yu Yu 10 Print this loop
#include<stdio.h>
int main()
{
int n = 0;
scanf("%d", &n);
int a = 0, b = 0,i=0;
while (n) //n The last digit is divided by 10 be equal to 0 For false , Exit loop
{
i++;
printf("%d", n % 10); // Print out the last bit
n = n / 10; // After printing the last digit, i 10 Find the next , The last digit is divided by 10 be equal to 0
}
return 0;
}
边栏推荐
猜你喜欢
Basic concepts of machine learning
分布式系统(二)分布式事务的理解
Simple making of master seal
Explication du script correspondant à l'assertion Postman
Installing MySQL databases in FreeBSD
biggan:large scale gan training for high fidelity natural image synthesis
Dataframe to list
Embedded c learning notes
23. histogram equalization
丨EGFR FISH 探针解决方案
随机推荐
Simple making of master seal
recv & send
GUN make (2) 总述
24. histogram calculation
One stop solution EMQ for hundreds of millions of communication of Internet of things
The 19th - 22nd week of scientific research training - about tnet and memnet
阳光男孩陈颢天 受邀担任第六季完美童模全球总决赛代言人
GUN make (5) makefile中的变量
甜酷少女金书伊 受邀担任第六季完美童模全球总决赛代言人
Dataframe converts the data type of a column
Summary of xlnet model
如何为政企移动办公加上一道“安全锁”?
Can bus transceiver principle
蒟蒻初学单片机的一丢丢笔记
Fasttext knowledge points summary
Talking about interface test (I)
PTA class a simulated second bullet: 1136-1139
Procédure de désinstallation complète de la base de données Oracle (pas de capture d'écran)
Perfdog
xargs 的作用详解