10 2012 档案

摘要:DescriptionIn the final exam, you are given n problems to solve, each one of which has an integer value indicating its difficulty, the larger, the harder. You need to find out which problem is the hardest.InputInput may contain several test cases, one per line. For each test case, the first integer 阅读全文
posted @ 2012-10-25 15:45 Joyee 阅读(418) 评论(0) 推荐(0)
摘要:DescriptionFind and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits when represented in hexadecimal (base 16) notation and also equals the sum of its digits when represented in duodecimal (base 12) notation.For examp 阅读全文
posted @ 2012-10-25 15:08 Joyee 阅读(881) 评论(0) 推荐(0)
摘要:本周的实验课堂上作业,课前已经完成Description陶陶家的院子里有一棵苹果树,每到秋天树上就会结出10个苹果。苹果成熟的时候,陶陶就会跑去摘苹果。陶陶有个30厘米高的板凳,当她不能直接用手摘到苹果的时候,就会踩到板凳上再试试。现在已知10个苹果到地面的高度,以及陶陶把手伸直的时候能够达到的最大高度,请帮陶陶算一下她能够摘到的苹果的数目。假设她碰到苹果,苹果就会掉下来。Input输入包括两行数据。第一行包含10个100到200之间(包括100和200)的整数(以厘米为单位)分别表示10个苹果到地面的高度,两个相邻的整数之间用一个空格隔开。第二行只包括一个100到120之间(包含100和12 阅读全文
posted @ 2012-10-25 14:42 Joyee 阅读(698) 评论(0) 推荐(0)
摘要:题目在IDE中输入手册上的代码,编译运行,结果如下答案与分析在该环境下,使用sizeof()查看short,unsigned与int类型所占内存字节数,得到的信息如下:(1)将一个大于 32767 的长整型数赋给短整型变量,会得到什么结果?答案:取该长整数二进制码的低16位进行存储,输出时若用转换说明符%d,则输出短整型的二进制存储方式中与这16位数相同的数。分析:由图可知,该环境下短整(short)型单元所占内存的字节数为2字节=16位,故其可存储的数据范围为,即-32768~32767,存储方式如下:存储方式(二进制)十进制数011111111111111132767…… ……000000 阅读全文
posted @ 2012-10-12 01:05 Joyee 阅读(1249) 评论(0) 推荐(0)