Debug客栈

Recent content on Debug客栈

马上订阅 Debug客栈 RSS 更新: https://blog.debuginn.com/index.xml

蓝桥杯 2017年省赛C++B组题5 取数位

2019年3月19日 21:57
Featured image of post 蓝桥杯 2017年省赛C++B组题5 取数位

求1个整数的第k位数字有很多种方法。

以下的方法就是一种。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// 求x用10进制表示时的数位长度
int len(int x){
 if(x<10) return 1;
 return len(x/10)+1;
}...

剩余内容已隐藏

查看完整文章以阅读更多