
c语言学习
wuxm_
这个作者很懒,什么都没留下…
展开
-
数据类型的范围
速查表:char -128 ~ +127 (1 Byte)short -32767 ~ + 32768 (2 Bytes)unsigned short 0 ~ 65536 (2 Bytes)int -2147483648 ~ +2147483647 (4 Bytes)unsigned int 0 ~ 4294967295 (4 Bytes)long == int转载 2015-12-14 18:30:22 · 204 阅读 · 0 评论 -
cantor表
Description现代数学的著名证明之一是Georg Cantor证明了有理数是可枚举的。他是用下面这一张表来证明这一命题的: 1/1 1/2 1/3 1/4 1/5 … 2/1 2/2 2/3 2/4 … 3/1 3/2 3/3 … 4/1 4/2 … 5/1 … … 我们以Z字形给上表的每一项编号。第一项是1/1,然后是1/2,2/1,3/1,2/2,…输入:n输出:表原创 2015-12-14 19:49:38 · 429 阅读 · 0 评论 -
两道桶排序题
问题一:描述:Input a couple of numbers (0~100) and end of EOF.If number > 20, it shuold be mapped to [0, 20],whitch is mean 'number %= 21'Output all these numbers by ascending oder. Output for原创 2015-12-14 15:45:54 · 369 阅读 · 0 评论 -
进制转换
问题一:十进制转其他进制将十进制数n转换成m进制数 mn样例输入 Sample Input 样例1:10 2样例2:100 15样例输出 Sample Output样例1:1010样例2:6Ahint:用反向取余法,注意n的范围。代码:#includeint main(){ int n,i,m,a[8]={0},l=7;//l原创 2015-12-15 21:44:16 · 388 阅读 · 0 评论 -
递推1
题目描述 Description我们要求找出具有下列性质数的个数(包含输入的自然数n):先输入一个自然数n(n1. 不作任何处理;2. 在它的左边加上一个自然数,但该自然数不能超过原数的一半;3. 加上数后,继续按此规则进行处理,直到不能再加自然数为止.输入描述 Input Description 一原创 2015-12-15 22:19:10 · 274 阅读 · 0 评论 -
各类型所占字节
转自:http://blog.youkuaiyun.com/lyl0625/article/details/7350045转载 2016-01-04 00:21:52 · 1464 阅读 · 0 评论