上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 91 下一页
摘要: Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are fri 阅读全文
posted @ 2019-02-28 21:57 王清河 阅读(235) 评论(0) 推荐(0)
摘要: British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an "Eddington number", E -- tha 阅读全文
posted @ 2019-02-27 22:32 王清河 阅读(463) 评论(0) 推荐(0)
摘要: Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each 阅读全文
posted @ 2019-02-27 22:31 王清河 阅读(353) 评论(0) 推荐(0)
摘要: On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear rep 阅读全文
posted @ 2019-02-27 22:31 王清河 阅读(408) 评论(0) 推荐(0)
摘要: The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input n 阅读全文
posted @ 2019-02-27 22:30 王清河 阅读(148) 评论(0) 推荐(0)
摘要: C++中支持的字符串处理的函数库叫String,但它不是STL,却与STL操作十分相似。 1.声明: 使用String之前要有以下头文件 声明方法 初始化string对象 直接初始化:利用小括号完成; 拷贝初始化:利用等号完成拷贝过程(减少使用); 以下是运行结果 输入字符串方法 如果想反复读入字符 阅读全文
posted @ 2019-02-26 23:00 王清河 阅读(310) 评论(0) 推荐(0)
摘要: 集装箱运输货物时,我们必须特别小心,不能把不相容的货物装在一只箱子里。比如氧化剂绝对不能跟易燃液体同箱,否则很容易造成爆炸。 本题给定一张不相容物品的清单,需要你检查每一张集装箱货品清单,判断它们是否能装在同一只箱子里。 输入格式: 输入第一行给出两个正整数:N (≤) 是成对的不相容物品的对数;M 阅读全文
posted @ 2019-02-25 22:09 王清河 阅读(375) 评论(0) 推荐(0)
摘要: 子曰:“三人行,必有我师焉。择其善者而从之,其不善者而改之。” 本题给定甲、乙、丙三个人的能力值关系为:甲的能力值确定是 2 位正整数;把甲的能力值的 2 个数字调换位置就是乙的能力值;甲乙两人能力差是丙的能力值的 X 倍;乙的能力值是丙的 Y 倍。请你指出谁比你强应“从之”,谁比你弱应“改之”。 阅读全文
posted @ 2019-02-25 21:37 王清河 阅读(152) 评论(0) 推荐(0)
摘要: 以下文字摘自《灵机一动·好玩的数学》:“狼人杀”游戏分为狼人、好人两大阵营。在一局“狼人杀”游戏中,1 号玩家说:“2 号是狼人”,2 号玩家说:“3 号是好人”,3 号玩家说:“4 号是狼人”,4 号玩家说:“5 号是好人”,5 号玩家说:“4 号是好人”。已知这 5 名玩家中有 2 人扮演狼人角 阅读全文
posted @ 2019-02-25 21:37 王清河 阅读(829) 评论(0) 推荐(0)
摘要: 当自然数 n 依次取 1、2、3、……、N 时,算式 ⌊ 有多少个不同的值?(注:⌊ 为取整函数,表示不超过 x 的最大自然数,即 x 的整数部分。) 输入格式: 输入给出一个正整数 N(2)。 输出格式: 在一行中输出题面中算式取到的不同值的个数。 输入样例: 输出样例: 阅读全文
posted @ 2019-02-25 21:36 王清河 阅读(768) 评论(0) 推荐(0)
上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 91 下一页