
----- 进制相关
谙忆
公众号:程序编程之旅。曾经写过C、C++,使用过Cocos2dx开发过游戏、安卓端、IOS端、PC端页面均开发过。目前专注Java开发,SaaS内核、元数据的研究。偶尔玩玩爬虫
-
原创 HDOJ(HDU) 2097 Sky数(进制)
Problem Description Sky从小喜欢奇特的东西,而且天生对数字特别敏感,一次偶然的机会,他发现了一个有趣的四位数2992,这个数,它的十进制数表示,其四位数字之和为2+9+9+2=22,它的十六进制数BB0,其四位数字之和也为22,同时它的十二进制数表示1894,其四位数字之和也为22,啊哈,真是巧啊。Sky非常喜欢这种四位数,由于他的发现,所以这里我们命名其为Sky数。但是要判2016-04-30 15:21:04794
0
-
原创 HDOJ(HDU) 2502 月之数(进制)
Problem Description 当寒月还在读大一的时候,他在一本武林秘籍中(据后来考证,估计是计算机基础,狂汗-ing),发现了神奇的二进制数。 如果一个正整数m表示成二进制,它的位数为n(不包含前导0),寒月称它为一个n二进制数。所有的n二进制数中,1的总个数被称为n对应的月之数。 例如,3二进制数总共有4个,分别是4(100)、5(101)、6(110)、7(111),他们中1的个2016-05-08 18:06:231276
0
-
原创 HDOJ(HDU) 1877 又一版 A+B(进制、、)
Problem Description 输入两个不超过整型定义的非负10进制整数A和B(<=231-1),输出A+B的m (1 < m <10)进制数。Input 输入格式:测试输入包含若干测试用例。每个测试用例占一行,给出m和A,B的值。 当m为0时输入结束。Output 输出格式:每个测试用例的输出占一行,输出A+B的m进制数。Sample Input 8 1300 48 2 1 72016-04-22 20:44:312117
0
-
原创 HDOJ(HDU) 1720 A+B Coming(进制)
Problem Description Many classmates said to me that A+B is must needs. If you can’t AC this problem, you would invite me for night meal. ^_^Input Input may contain multiple test cases. Each case con2016-04-22 00:41:471040
0
-
原创 HDOJ 2031 进制转换
Problem Description 输入一个十进制数N,将它转换成R进制数输出。Input 输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(2<=R<=16, R<>10)。Output 为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的数字规则参考16进制(比如,10用A表示,等等)。Sample Input 7 2 23 12 -4 32016-01-22 18:06:52626
0
-
原创 HDOJ 1196 Lowest Bit(二进制相关的简单题)
Problem Description Given an positive integer A (1 <= A <= 100), output the lowest bit of A.For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the outp2016-04-03 12:07:49794
0
-
原创 HDOJ 1335 Basically Speaking(进制转换)
Problem Description The Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I calculator. As a computer scientist you suggested to the company tha2016-04-09 14:02:581402
0
-
原创 HDOJ 1390 Binary Numbers(进制问题)
Problem Description Given a positive integer n, find the positions of all 1’s in its binary representation. The position of the least significant bit is 0.ExampleThe positions of 1’s in the binary rep2016-04-09 15:05:302008
0
-
原创 HDOJ(HDU) 2106 decimal system(进制相互转换问题)
Problem Description As we know , we always use the decimal system in our common life, even using the computer. If we want to calculate the value that 3 plus 9, we just import 3 and 9.after calculation2016-05-01 16:18:39846
0
-
原创 HDOJ/HDU 2352 Verdis Quo(罗马数字与10进制数的转换)
Problem Description The Romans used letters from their Latin alphabet to represent each of the seven numerals in their number system. The list below shows which letters they used and what numeric val2016-06-05 01:29:025101
0