#includeint main(){ int s,l; double rate; scanf("%d%d",&s,&l); rate=(double)(s-l)/l*100; if(rate<10) printf("OK\n"); else if(rate<50) prin...
分类:
其他好文 时间:
2015-02-13 18:12:43
阅读次数:
220
The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed to generate the ranklist ...
分类:
其他好文 时间:
2015-02-13 17:51:28
阅读次数:
206
乌龟与兔子进行赛跑,跑场是一个矩型跑道,跑道边可以随地进行休息。乌龟每分钟可以前进3米,兔子每分钟前进9米;兔子嫌乌龟跑得慢,觉得肯定能跑赢乌龟,于是,每跑10分钟回头看一下乌龟,若发现自己超过乌龟,就在路边休息,每次休息30分钟,否则继续跑10分钟;而乌龟非常努力,一直跑,不休息。假定乌龟与兔子在同一起点同一时刻开始起跑,请问T分钟后乌龟和兔子谁跑得快?
输入格式:
输入在一行中给出比赛时间...
分类:
其他好文 时间:
2015-02-13 14:52:10
阅读次数:
254
本题要求实现一个简易连连看游戏模拟程序。
给定一个2Nx2N的方阵网格游戏盘面,每个格子中放置一些符号。这些符号一定是成对出现的,同一个符号可能不止一对。程序读入玩家给出的一对位置(x1, y1)、(x2, y2),判断这两个位置上的符号是否匹配。如果匹配成功,则将两个符号消为“*”并输出消去后的盘面;否则输出“Uh-oh”。若匹配错误达到3次,则输出“Game Over”并结束游戏。或者当全部...
分类:
编程语言 时间:
2015-02-13 14:51:24
阅读次数:
234
将N个整数按从小到大排序的冒泡排序法是这样工作的:从头到尾比较相邻两个元素,如果前面的元素大于其紧随的后面元素,则交换它们。通过一遍扫描,则最后一个元素必定是最大的元素。然后用同样的方法对前N-1个元素进行第二遍扫描。依此类推,最后只需处理两个元素,就完成了对N个数的排序。
本题要求对任意给定的K(
输入格式:
输入在第1行中给出N和K(1
输出格式:
在一行中输出冒泡排序法扫描完第K遍...
分类:
编程语言 时间:
2015-02-13 14:50:07
阅读次数:
347
本题要求编写程序,计算两个二维平面向量的和向量。
输入格式:
输入在一行中按照“x1 y1 x2 y2”的格式给出两个二维平面向量V1=(x1, y1)和V2=(x2, y2)的分量。
输出格式:
在一行中按照“(x, y)”的格式输出和向量,坐标输出小数点后1位(注意不能输出-0.0)。
输入样例:
3.5 -2.7 -13.9 8.7
输出样例:
(-10.4, 6.0)
...
分类:
其他好文 时间:
2015-02-13 14:49:13
阅读次数:
307
This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was captured by a group of d...
分类:
其他好文 时间:
2015-02-12 21:25:40
阅读次数:
365
For a given undirected graph with N vertices and E edges, please list all the connected components by both DFS and BFS. Assume that all the vertices a...
分类:
其他好文 时间:
2015-02-12 20:08:39
阅读次数:
145
In 1953, David A. Huffman published his paper "A Method for the Construction of Minimum-Redundancy Codes", and hence printed his name in the history o...
分类:
其他好文 时间:
2015-02-11 18:21:50
阅读次数:
206
We have a network of computers and a list of bi-directional connections. Each of these connections allows a file transfer from one computer to another...
分类:
其他好文 时间:
2015-02-11 18:15:42
阅读次数:
186