03 2016 档案
摘要:题目描述 Before bridges were common, ferries were used to transport cars across rivers. River ferries, unlike their larger cousins, run on a guide line and are powered by the river’s current. Cars drive ...
阅读全文
摘要:题目描述 There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, c...
阅读全文
摘要:题目描述 The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms each on the north side and south side along t...
阅读全文
摘要:题目描述 Here is a famous story in Chinese history. “That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.” “Both...
阅读全文
摘要:problemE 题目描述 “今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%…” 确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。 作 为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、 超级女生,以及王小...
阅读全文
摘要:这些函数由于设计的时候比较淳朴,并没有做任何的越界检测,主要容易”被溢出”,只需要多设点检查边界,即安全。 函数 严重性 解决方案 gets 最危险 使用 fgets(buf, size, stdin)。这几乎总是一个大问题! strcpy 很危险 改为使用 strncpy。 strcat 很危险 改为使用 strncat。 ...
阅读全文
摘要:要求如题 头文件stdlib.h中有一个函数atof() 可以将字符串转化为双精度浮点数(double) double atof(const char *nptr); 此字符串为C风格字符串,因此需要将string转化为C风格字符串 此时可用到一个函数c_str() const char *c_str() 参考资料: string中c_str()、data()、copy(...
阅读全文