摘要: 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 @ 2020-03-21 21:25 zzzlight 阅读(135) 评论(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 @ 2020-03-21 21:24 zzzlight 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Given two sets of integers, the similarity of the sets is defined to be /, where N​c​​ is the number of distinct common numbers shared by the two sets 阅读全文
posted @ 2020-03-21 21:22 zzzlight 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou 阅读全文
posted @ 2020-03-21 21:17 zzzlight 阅读(153) 评论(0) 推荐(0) 编辑
摘要: There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any s 阅读全文
posted @ 2020-03-21 21:12 zzzlight 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 在c与c++中,有多种办法可以通过函数交换传入的两数的值,但有容易有一些问题产生,因而本文将几种交换方式及容易出错的点进行了分类。 1.传引用这是c++中最常见方式如下: int swap1 (int &a,int &b) { int c; c=a; a=b; b=c; cout<<"a1:"<<a 阅读全文
posted @ 2020-03-21 21:03 zzzlight 阅读(1356) 评论(0) 推荐(0) 编辑
摘要: 1.先cd切换到工作的目录 2.进入项目文件夹,通过命令git init将项目初始化成git本地仓库 git init 2、将项目内所有文件都添加到暂存区 git add . //用.是当前目录,也可自己选择文件加入 3、对本次的提交进行备注,以便后期版本回退等操作 git commit -m 'x 阅读全文
posted @ 2020-03-21 20:34 zzzlight 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 在使用getline读入一整行时,若是前面是使用getchar()、cin这类读入了一个字母,但是不会读入后续换行\n符号或者空格的输入时,再接getline()就容易出现问题。 这是因为输入数字之后,敲回车,产生的换行符仍然滞留在输入流了,接着就被getline(cin,s)给读进去了,此时的s= 阅读全文
posted @ 2020-03-21 19:59 zzzlight 阅读(3625) 评论(0) 推荐(0) 编辑