摘要: Given a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 ... 阅读全文
posted @ 2015-01-15 15:05 繁星苑 阅读(938) 评论(0) 推荐(0) 编辑
摘要: Rotating SentencesIn ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the in... 阅读全文
posted @ 2014-12-16 21:57 繁星苑 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Sample Input(character"B"for ease of reading. The actual input file will use the ASCII-space character, not"B").4XXXXBBBBBBBBBBBBBBBBXXXXXXXXBBBBBBBBB... 阅读全文
posted @ 2014-12-16 14:00 繁星苑 阅读(11699) 评论(0) 推荐(0) 编辑
摘要: Kindergarten Counting GameEverybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!''Now, could someone tell me how man... 阅读全文
posted @ 2014-12-15 20:45 繁星苑 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Write a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded ... 阅读全文
posted @ 2014-12-15 15:20 繁星苑 阅读(499) 评论(0) 推荐(0) 编辑
摘要: Problem AHashmat the brave warriorInput:standard inputOutput:standard outputHashmat is a brave warrior who with his group of young soldiers moves from... 阅读全文
posted @ 2014-12-14 15:56 繁星苑 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 让我们定义 dn为:dn= pn+1- pn,其中 pi是第i个素数。显然有 d1=1 且对于n>1有 dn是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。现给定任意正整数N ( 2 #include 3 #include 4 #define MAXN 100000 5 int a... 阅读全文
posted @ 2014-05-13 20:15 繁星苑 阅读(6658) 评论(0) 推荐(1) 编辑
摘要: 给定一系列正整数,请按要求对数字进行分类,并输出以下5个数字:A1 = 能被5整除的数字中所有偶数的和;A2 = 将被5除后余1的数字按给出顺序进行交错求和,即计算n1-n2+n3-n4...;A3 = 被5除后余2的数字的个数;A4 = 被5除后余3的数字的平均数,精确到小数点后1位;A5 = 被... 阅读全文
posted @ 2014-05-13 11:33 繁星苑 阅读(5217) 评论(0) 推荐(0) 编辑
摘要: 1021. 个位数统计 (15)给定一个k位整数N = dk-1*10k-1+ ... + d1*101+ d0(00),请编写程序统计每种不同的个位数字出现的次数。例如:给定N = 100311,则有2个0,3个1,和1个3。输入格式:每个输入包含1个测试用例,即一个不超过1000位的正整数N。输... 阅读全文
posted @ 2014-05-13 10:20 繁星苑 阅读(2622) 评论(0) 推荐(0) 编辑
摘要: 1016. 部分A+B (15)正整数A的“DA(为1位整数)部分”定义为由A中所有DA组成的新整数PA。例如:给定A = 3862767,DA= 6,则A的“6部分”PA是66,因为A中有2个6。现给定A、DA、B、DB,请编写程序计算PA+ PB。输入格式:输入在一行中依次给出A、DA、B、DB... 阅读全文
posted @ 2014-05-12 16:37 繁星苑 阅读(2069) 评论(0) 推荐(0) 编辑