上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: 题目描述 一个正整数,如果从左向 右读(称之为正序数)和从右向左读(称之为倒序数)是一样的,这样的数就叫回文数。输入两个整数m和n(m<n),输出区间[m,n]之间的回文数。 一个正整数,如果从左向 右读(称之为正序数)和从右向左读(称之为倒序数)是一样的,这样的数就叫回文数。输入两个整数m和n(m 阅读全文
posted @ 2018-11-25 20:49 Binary_tony 阅读(660) 评论(0) 推荐(0) 编辑
摘要: 题目描述 输入两个正整数m和n,顺序输出m到n之间的所有友好数对。 如果两个整数的所有正因子之和(包括1,不包括自身)等于对方,就称这对数是友好的。例如:1184和1210是友好数对,因为 1184的因子之和为1+2+4+8+16+32+37+74+148+296+592=1210 1210的因子之 阅读全文
posted @ 2018-11-25 20:48 Binary_tony 阅读(1947) 评论(0) 推荐(0) 编辑
摘要: 题目描述 输入正整数n(2<=n<=1000),计算并输出n的所有正因子(包括1,不包括自身)之和。要求程序定义一个FacSum ()函数和一个main()函数,FacSum ()函数计算并返回n的所有正因子之和,其余功能在main()函数中实现。 int FacSum(int n) { //计算n 阅读全文
posted @ 2018-11-25 20:47 Binary_tony 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 题目描述 平均学分绩点(Grade Point Average,即GPA)是以学分与绩点作为衡量学生学习的量与质的计算单位,以取得一定的学分和平均学分绩点作为毕业和获得学位的标准,实施多样的教育规格和较灵活的教学管理制度。 大学里每一门课程都有一定的学分。只有通过这门课的考试,才能获得相应的学分。课 阅读全文
posted @ 2018-11-25 20:46 Binary_tony 阅读(802) 评论(0) 推荐(0) 编辑
摘要: 删除链表中等于给定值 val 的所有节点。 示例: 输入: 1->2->6->3->4->5->6, val = 6 输出: 1->2->3->4->5 package leetcode; public class leetcode203 { /* * 完全借鉴别人的code 解题思路: * * ( 阅读全文
posted @ 2018-11-25 20:41 Binary_tony 阅读(349) 评论(0) 推荐(0) 编辑
摘要: Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minut 阅读全文
posted @ 2018-11-25 19:53 Binary_tony 阅读(142) 评论(0) 推荐(0) 编辑
摘要: This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Inp 阅读全文
posted @ 2018-11-24 20:46 Binary_tony 阅读(666) 评论(0) 推荐(0) 编辑
摘要: Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the 阅读全文
posted @ 2018-11-22 22:53 Binary_tony 阅读(151) 评论(0) 推荐(0) 编辑
摘要: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文
posted @ 2018-11-21 20:42 Binary_tony 阅读(661) 评论(0) 推荐(0) 编辑
摘要: 给定一个二叉树,找出其最大深度。 二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。 说明: 叶子节点是指没有子节点的节点。 示例: 给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回它的最大深度 3 。 int maxDepth(Tre 阅读全文
posted @ 2018-11-14 19:34 Binary_tony 阅读(140) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 11 下一页