摘要:
Problem Description8600的手机每天消费1元,每消费K元就可以获赠1元,一开始8600有M元,问最多可以用多少天?Input输入包括多个测试实例.每个测试实例包括2个整数M, k,(2 <= k <= M <= 1000).M = 0, k = 0代表输入结束.Output对于每个测试实例输出一个整数,表示M元可以用的天数。Sample Input2 24 30 0Sample Output35题意:中文题目,就不多说了,略。分析:水题,看代码吧。AC源代码(C语言): 1 #include<stdio.h> 2 3 int main() 4 阅读全文
摘要:
Problem Description每天第一个到机房的人要把门打开,最后一个离开的人要把门关好。现有一堆杂乱的机房签 到、签离记录,请根据记录找出当天开门和关门的人。Input测试输入的第一行给出记录的总天数N ( > 0 )。下面列出了N天的记录。 每天的记录在第一行给出记录的条目数M ( > 0 ),下面是M行,每行的格式为证件号码 签到时间 签离时间其中时间按“小时:分钟:秒钟”(各占2位)给出,证件号码是长度不超过15的字符串。Output对每一天的记录输出1行,即当天开门和关门人的证件号码,中间用1空格分隔。 注意:在裁判的标准测试输入中,所有记录保证完整,每个人的签到 阅读全文
摘要:
数据结构初解之单链表分析篇一、头文件例:#include<stdio.h>#include<stdlib.h>分析:1、stdio.h可以说是最基本的头文件,scanf和printf函数都在里面。2、stdlib.h中包含malloc()函数。二、宏定义例:#defineQUIT-1分析:1、QUIT是自定义的在链表中输入数据的结束符号。2、宏定义和类型定义符的功能很相似。但是宏定义是由预处理完成的,所以它带有预处理指令符#,而类型定义符typedef就没有。但是typedef语句后面要有“;”。3、关于#define更详细的知识可以查找其他资料。三、使用类型定义符ty 阅读全文
摘要:
Problem DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs. Consider the following algor 阅读全文
摘要:
Digital RootsProblem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the process is repeated. 阅读全文
摘要:
Problem DescriptionA simple mathematical formula for e iswhere n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.OutputOutput the approximations of e generated by the above formula for the values of n from 0 to 9. The begi... 阅读全文
摘要:
Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to move down one floor. The 阅读全文
摘要:
数据传递类指令 以累加器为目的操作数的指令 MOV A,Rn MOV A,direct MOV A,@Ri MOV A,#data 第一条指令中,Rn代表的是R0-R7。第二条指令中,direct就是指的直接地址,而第三条指令中,就是我们刚才讲过的。第四条指令是将立即数data送到A中。下面我们通过一些例子加以说明: MOV A,R1 ;将工作寄存器R1中的值送入A,R1中的值保持不变。 MOV A,30H ;将内存30H单元中的值送入A,30H单元中的值保持不变。 MOV A,@R1 ;先看R1中是什么值,把这个值... 阅读全文
摘要:
Problem C: WERTYUA common typing error is to place the hands on the keyboard one row to the right of the correct position. So "Q" is typed as "W" and "J" is typed as "K" and so on. You are to decode a message typed in this manner.Input consists of several line 阅读全文
摘要:
Problem Description读入N名学生的成绩,将获得某一给定分数的学生人数输出。Input测试输入包含若干测试用例,每个测试用例的格式为第1行:N第2行:N名学生的成绩,相邻两数字用一个空格间隔。第3行:给定分数当读到N=0时输入结束。其中N不超过1000,成绩分数为(包含)0到100之间的一个整数。Output对每个测试用例,将获得给定分数的学生人数输出。Sample Input3 80 60 9060 2 85 66 05 60 75 90 55 7575 0Sample Output102 题意:略!分析:运用数组,将给定的分数与数组中存储的数据相比较即可。AC源代码(C语言 阅读全文