摘要: 描述 Sally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is count... 阅读全文
posted @ 2018-04-21 23:18 xzhws 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 题目链接 解题思路: 贪心,从面积最大的开始,分情况考虑...... # include# include//装箱问题,贪心,分情况讨论using namespace std;int main(){ int a,b,c,d,e,f; int sum2,... 阅读全文
posted @ 2018-04-21 13:30 xzhws 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 描述Background There are a lot of monkeys in a mountain. Every one wants to be the monkey king. They keep arguing with each other ab... 阅读全文
posted @ 2018-04-14 23:33 xzhws 阅读(26) 评论(0) 推荐(0) 编辑
摘要: Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable,... 阅读全文
posted @ 2018-04-13 22:03 xzhws 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 描述约瑟夫问题:有n只猴子,按顺时针方向围成一圈选大王(编号从1到n),从第1号开始报数,一直数到m,数到m的猴子退出圈外,剩下的猴子再接着从1开始报数。就这样,直到圈内只剩下一只猴子时,这个猴子就是猴王,编程求输入n,m后,输出最后猴王的编号。输入每行是用空... 阅读全文
posted @ 2018-04-12 23:50 xzhws 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 将一个长度最多为30位数字的十进制非负整数转换为二进制数输出。 输入描述: 多组数据,每行为一个长度不超过30位的十进制非负整数。(注意是10进制数字的个数可能有30个,而非30bits的整数) 输出描述: 每行输出对应的二进制数。 ... 阅读全文
posted @ 2018-04-12 00:03 xzhws 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Tino wrote a long long story. BUT! in Chinese... So I have to tell you the problem directly and discard his long long story.... 阅读全文
posted @ 2018-04-08 21:44 xzhws 阅读(74) 评论(0) 推荐(0) 编辑
摘要: //实现字符串的查找、删除、替换# include# include//字符串的查找int find(char *str1,char *str2)//在str1中寻找str2{ int len1=strlen(str1); int len2=strlen... 阅读全文
posted @ 2018-04-08 11:15 xzhws 阅读(45) 评论(0) 推荐(0) 编辑
摘要: //实现字符串的查找、删除、替换 # include # include //字符串的查找 int find(char *str1,char *str2)//在str1中寻找str2 { int len1=strlen(str1); int len2=strlen(str2); int i=0,index; if(len1<len2) retur... 阅读全文
posted @ 2018-04-08 11:15 xzhws 阅读(482) 评论(0) 推荐(0) 编辑
摘要: Problem Description 搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决... 阅读全文
posted @ 2018-04-07 10:45 xzhws 阅读(39) 评论(0) 推荐(0) 编辑