随笔分类 - C
摘要:Rotating SentencesIn ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the in...
阅读全文
摘要:Sample Input(character"B"for ease of reading. The actual input file will use the ASCII-space character, not"B").4XXXXBBBBBBBBBBBBBBBBXXXXXXXXBBBBBBBBB...
阅读全文
摘要:Kindergarten Counting GameEverybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!''Now, could someone tell me how man...
阅读全文
摘要: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 ...
阅读全文
摘要:Problem AHashmat the brave warriorInput:standard inputOutput:standard outputHashmat is a brave warrior who with his group of young soldiers moves from...
阅读全文
摘要:让我们定义 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...
阅读全文
摘要:给定一系列正整数,请按要求对数字进行分类,并输出以下5个数字:A1 = 能被5整除的数字中所有偶数的和;A2 = 将被5除后余1的数字按给出顺序进行交错求和,即计算n1-n2+n3-n4...;A3 = 被5除后余2的数字的个数;A4 = 被5除后余3的数字的平均数,精确到小数点后1位;A5 = 被...
阅读全文
摘要:1021. 个位数统计 (15)给定一个k位整数N = dk-1*10k-1+ ... + d1*101+ d0(00),请编写程序统计每种不同的个位数字出现的次数。例如:给定N = 100311,则有2个0,3个1,和1个3。输入格式:每个输入包含1个测试用例,即一个不超过1000位的正整数N。输...
阅读全文
摘要: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...
阅读全文
摘要:让我们用字母B来表示“百”、字母S表示“十”,用“12...n”来表示个位数字n( 2 #include 3 #define MAXN 9 4 int c1[MAXN]; 5 char c2[MAXN]; 6 char c3[MAXN]; 7 int main() 8 { 9 int i,j...
阅读全文

浙公网安备 33010602011771号