TinaCristal's Blog


  • Home

  • Tags

  • Categories

  • Archives

  • Search

CSS padding margin border属性详解

Posted on 2018-12-31 | In css

W3C组织建议把所有网页上的对像都放在一个盒(box)中,设计师可以通过创建定义来控制这个盒的属性,这些对像包括段落、列表、标题、图片以及层。盒模型主要定义四个区域:内容(content)、内边距(padding)、边框(border)和外边距(margin)。对于初学者,经常会搞不清楚margin,background-color,background-image,padding,content,border之间的层次、关系和相互影响。这里提供一张盒模型的3D示意图,希望便于你的理解和记忆。
image
margin:层的边框以外留的空白

Read more »

input中的value和placeholder

Posted on 2018-12-31 | In html

input中value和placeholder区别

placeholder 属性提供可描述输入字段预期值的提示信息(hint)。
该提示会在输入字段为空时显示,并会在字段获得焦点时消失。
注释:placeholder 属性适用于以下的 类型:text, search, url, telephone, email 以及 password。

Read more »

html标签

Posted on 2018-12-29 | In web

HTML5 标签
comment 注释标签用于在源文档中插入注释。注释内容不会被浏览器显示。为代码编写注释的好处是,有助于增强代码的可读性。

Read more »

复数运算

Posted on 2018-12-23 | In 蓝桥杯

编程实现两个复数的运算。设有两个复数 和 ,则他们的运算公式为:

  要求:(1)定义一个结构体类型来描述复数。
  (2)复数之间的加法、减法、乘法和除法分别用不用的函数来实现。
  (3)必须使用结构体指针的方法把函数的计算结果返回。
  说明:用户输入:运算符号(+,-,*,/) a b c d.
  输出:a+bi,输出时不管a,b是小于0或等于0都按该格式输出,输出时a,b都保留两位。

Read more »

算法训练 小朋友排队

Posted on 2018-12-23 | In 蓝桥杯

问题描述

  n 个小朋友站成一排。现在要把他们按身高从低到高的顺序排列,但是每次只能交换位置相邻的两个小朋友。

  每个小朋友都有一个不高兴的程度。开始的时候,所有小朋友的不高兴程度都是0。

Read more »

53-C++ CH08 01

Posted on 2018-12-23 | In 蓝桥杯

问题描述

已知一个有理数类Zrf_Ratio,实现如下的操作符重载形式:
  friend std::ostream& operator<<(std::ostream&, const zrf_Ratio&);//输出最简分数
  friend std::istream& operator>>(std::istream&, zrf_Ratio&);
  friend bool operator==(const zrf_Ratio&, const zrf_Ratio&);
  friend bool operator<(const zrf_Ratio&, const zrf_Ratio&);

Read more »

历届试题 连号区间数

Posted on 2018-12-22

问题描述
小明这些天一直在思考这样一个奇怪而有趣的问题:

Read more »

国王的烦恼

Posted on 2018-12-22 | In 蓝桥杯

问题描述
  C国由n个小岛组成,为了方便小岛之间联络,C国在小岛间建立了m座大桥,每座大桥连接两座小岛。两个小岛间可能存在多座桥连接。然而,由于海水冲刷,有一些大桥面临着不能使用的危险。

Read more »

树状数组 统计序列中在元素左边比该元素小的元素个数

Posted on 2018-12-22 | In c++

统计序列中在元素左边比该元素小的元素个数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include<bits/stdc++.h>
#define MAX 100
using namespace std;
#define lowbit(i) ((i)&(-i))
//覆盖范围
int c[MAX];
int n;
void update(int x,int v){
for(int i=x;i<=n;i+=lowbit(i)){
c[i]+=v;
}
}
int getSum(int x){
int sum=0;
for(int i=x;i>0;i-=lowbit(i))
{
sum+=c[i];
}
return sum;
}

int main(){
cin>>n;
int x;
memset(c,0,sizeof(c));
int num=0;
for(int i=1;i<=n;i++){
cin>>x;
update(x,1);//x出现次数+1
int t=getSum(x-1);
num+=t;
cout<<"第"<<i<<"位左边比它小的数的个数"<<t<<endl;
}
cout<<"sum:"<<num<<endl;



}

image

蓝桥杯 分糖果

Posted on 2018-12-21 | In 蓝桥杯

问题描述

有n个小朋友围坐成一圈。老师给每个小朋友随机发偶数个糖果,然后进行下面的游戏:

Read more »

1…111213…45

TinaCristal

443 posts
57 categories
55 tags
GitHub E-Mail
© 2020 TinaCristal
Powered by Hexo
|
Theme — NexT.Mist v5.1.4