摘要: 效果: 对于不规则图片,在屏幕缩小时图片适当左移,但为了不遮挡左侧文字,左移至一定位置后图片固定位置。 方法: 给背景图片设置宽度和absolute定位,使得图片浮于页面。然后在js里边判断当前窗口大小,当页面小到会致使图片遮挡左侧文字时,给图片添加left属性,这样图片就不会再向左移动了(如果文字 阅读全文
posted @ 2019-10-11 17:39 程嘿嘿 阅读(1973) 评论(0) 推荐(0) 编辑
摘要: 头文件 使用map应包含map头文件 map的定义和初始化 定义: map<int,int> m; 尖括号内第一个数据类型表示键的类型,第二个为值的数据类型 初始化: 方法一:直接指定键,并赋值 例1: 结果为: key:1value is:1000 方法二:插入键值对 例2: 结果为: key:1 阅读全文
posted @ 2019-10-11 16:53 程嘿嘿 阅读(4272) 评论(0) 推荐(0) 编辑
摘要: string的find()函数用于找出字母在字符串中的位置。 find(str,position) find()的两个参数: str:是要找的元素 position:字符串中的某个位置,表示从从这个位置开始的字符串中找指定元素。 可以不填第二个参数,默认从字符串的开头进行查找。 返回值为目标字符的位 阅读全文
posted @ 2019-10-11 15:23 程嘿嘿 阅读(39459) 评论(0) 推荐(1) 编辑
摘要: Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL 阅读全文
posted @ 2019-10-11 14:56 程嘿嘿 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Medium Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O 阅读全文
posted @ 2019-10-11 14:30 程嘿嘿 阅读(126) 评论(0) 推荐(0) 编辑