(转)winform之RichTextBox
RichTextBox是一种可用于显示、输入和操作格式文本,除了可以实现TextBox的所有功能,还能提供富文本的显示功能。 控件除具有TextBox 控件的所有功能外,还能设定文字颜色、字体和段落格式,支持字符串查找功能,支持rtf格式等功能。
下面就其的常用到的功能进行介绍。
一、显示滚动条
RichTextBox可设置Multiline属性来控制是否显示滚动套,true为是,false为否。,默认为true。(此项属性在TextBox亦可实现)
滚动条分为两种:水平(Horizontal)滚动条和垂直(Vertical)滚动条,通过RichTextBox的ScrollBars属性设置如何显示滚动条。(此项属性在TextBox亦可实现)
ScrollBars属性值:
1、Both:只有当文本超过RichTextBox的宽度或长度时,才显示水平滚动条或垂直滚动条,或两个滚动条都显示。
2、None:从不显示任何类型的滚动条。
3、Horizontal:只有当文本超过RichTextBox的宽度时,才显示水平滚动条。必须将WordWrap属性设置为false,才会出现这种情况。(下面将会给出解释)
4、Vertical:只有档文本超过RichTextBox的高度时,才显示垂直滚动条。
5、ForcedHorizontal:当WordWrap属性设置为false时,显示水平滚动条。在文本未超过RichTextBox的宽度时,该滚动条显示为浅灰色。
6、ForcedVertical:始终显示垂直滚动条。在文本未超过RichTextBox的长度时,该滚动条显示为浅灰色。
7、ForcedBoth:始终显示垂直滚动条。当WordWrap属性设置为false时,显示水平滚动条。在文本未超过RichTextBox的宽度或长度时,两个滚动条均显示为灰色。
注:RichTextBox的WordWrap属性:用于指示多行文本框控件在必要时是否换行到下一行的开始。当属性为true时,不论ScrollBars属性值是什么,都不会显示水平滚动条。
下面通过几个截图加以描述其区别。(此项属性TextBox亦可实现)
(1)、当WordWrap为true,ScrollBars为Both时:
由此可见,WordWrap为true时,一旦文本超过RichTextBox的宽度时,就会自动换行到下一行,自然不需要用到水平滚动条,也就不显示出来了。
(2)、当WordWrap为false,ScrollBars为Both时:
由此可知,WordWrap为false时,即使文本超过RichTextBox的宽度,也不会自动换行到下一行,只有用户输入回车时才会换行,并且当文本超过RichTextBox的宽度后,才会显示水平滚动条。
代码实现过程:
private
void
Form1_Load(
object
sender, EventArgs e)
//窗体的Load事件
{
richTextBox1.Multiline =
true
;
//将Multiline属性设置为true,实现显示多行
richTextBox1.ScrollBars = RichTextBoxScrollBars.Vertical;
//设置ScrollBars属性实现只显示垂直滚动
}
二、设置字体属性
可通过RichTextBox的Font属性和ForeColor属性设置(Visual Studio2013社区版找不到SelectionFont和SelectionColor属性),也可通过代码实现,如文本字体设置为楷体,字体大小为12,字样是粗体,文本颜色为红色:
private
void
Form1_Load(
object
sender, EventArgs e)
//窗体的Load事件
{
richTextBox1.Multiline =
true
;
//将Multiline属性设为true,实现显示多行
richTextBox1.ScrollBars = RichTextBoxScrollBars.Vertical;
//设置ScrollBars属性实现只显示垂直滚动条
richTextBox1.SelectionFont =
new
Font (
"楷体"
, 12, FontStyle.Bold);
//设置SelectionFont属性实现控件中的文本为楷体,大小为12,字样是粗体
richTextBox1.SelectionColor = System.Drawing.Color.Red;
//设置SelectionColor属性实现控件中的文本颜色为红色
}
将RichTextBox控件显示为超链接样式
将以“http://”开头的Web链接地址作为超链接文本时,运行时RichTextBox超链接文本会自动变成蓝色字体且有下划线。
此时点击超链接文本不会有任何响应,需要在RichTextBox的LinkClicked事件中编写代码实现。
private
void
Form1_Load(
object
sender, EventArgs e)
//窗体的Load事件
{
richTextBox1.Multiline =
true
;
//将Multiline属性设为true,实现显示多行
richTextBox1.ScrollBars = RichTextBoxScrollBars.Vertical;
//设置ScrollBars属性实现只显示垂直滚动条
richTextBox1.Text =
"http://www.baidu.com百度一下你就知道"
; //设置Text属性
}
private
void
richTextBox1_LinkClicked(
object
sender, EventArgs e)
{
System.Diagnostics.Process.Start(e.LinkText);
//在控件LinkClicked事件中编写如下代码实现内容中的网址单击后可以访问网址
}
三、设置段落格式
可通过设置SelectionBullet属性将选定的段落设置为项目符号列表的格 式,也可以使用SelectionIndent属性和SelectionHangingIndent属性设置段落相对于控件的左右边缘进行缩进。下面用代 码将控件的SelectionBullet属性设置为true,使控件中的内容以项目符号列表的格式排列。
private
void
Form1_Load(
object
sender, EventArgs e)
{
richTextBox1.Multiline =
true
;
richTextBox1.ScrollBars = RichTextBoxScrollBars.Vertical ;
richTextBox1.SelectionBullet =
true
;
}
以下为属性SelectionBullet设为false和true时的差异(前者为false后者为true):
通过SelectionIndent属性设置一个整数,该整数表示控件的左边缘和文本的左边缘之间的距离(以像素为单位)。通过SelectionRightIndent属性设置一个整数,该整数表示控件的右边缘与文本的右边缘之间的距离(以像素为单位)。
以下通过代码实现SelectionIndent属性设置。
private
void
Form1_Load(
object
sender, EventArgs e)
{
richTextBox1.Multiline =
true
;
richTextBox1.ScrollBars = RichTextBoxScrollBars.Vertical ;
richTextBox1.SelectionIndent = 50 ;
}
差异如下组图:
SelectionRightIndent属性与SelectionIndent属性类似,可类比,当然也可以同时使用。
四、常用功能
1.RichTextBox控件的常用属性
1)SelectedText属性、SelectionLength属性、SelectionStart属性——与TextBox控件的属性功能相同。
2)SelectionFont:获取或设置选中的文本或插入点的字体,例如:
1
|
richTextBox1.SelectionFont=fontDialog1.Font; //设置为字体对话框中选中的字体 |
3)SelectionColor:获取或设置选中的文本或插入点的文本颜色。
5)Lines属性——字符串数组。记录输入到RichText控件中的所有文本,每按两次回车键之间的字符串是该数组的一个元素。
6)Modifyed属性——记录用户是否已修改控件中的文本内容。若已修改,该属性值自动设置为true。
7)HideSelection属性——设置当焦点离开该控件时,选定的文本是否保持突出显示。值为false时突出显示。
2.RichTextBox控件的常用事件
1)SelectionChange事件——控件中选中的文本发生改变时,触发该事件。
2)TextChanged事件——控件中的文本内容发生改变时,触发该事件。
3.RichTextBox控件的常用方法
1)Clear( )方法——清除RichText控件中用户输入的所有内容。
2)Copy( )、Cut( )、Paste( )方法——实现RichText控件的剪贴板功能;
3)SelectAll( )方法——选中控件中的所有文本。 4)Find( )方法——实现查找功能。
5)SaveFile( )方法、LoadFile( )方法——保存文本和打开文件。
6)Undo( )方法、Redo( )方法——撤销上一次编辑操作、重做上次撤销的编辑操作。
说明:常与CanUndo属性和CanRedo属性配合使用。
7)LoadFile()——加载文本文件(*.txt)或RTF文件(*.rtf)。
8)SaveFile()——保存文本文件(*.txt)或RTF文件(*.rtf)。
4. 将文件加载到RichTextBox 对象中
使用LoadFile( )方法.
(1)一般格式
RichTextBox对象名.LoadFile(文件名,文件类型);
(2)说明
RichTextBox 控件可以显示纯文本、Unicode 纯文本或 RTF 格式文件。若要显示这些文件,可调用 LoadFile 方法。例如,使用打开文件对话框选择一个文本文件并加载到richTextBox1控件中,代码如下:
openFileDialog1.Filter=
"文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"
;
if
(openFileDialog1.ShowDialog()==DialogResult.OK)
{
string
fName=openFileDialog1.FileName;
richTextBox1.LoadFile(fName,RichTextBoxStreamType.PlainText );
}
RichTextBoxStreamType.PlainText为加载的文件类型,其他可选的枚举值如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAsEAAAEUCAIAAABFyHwiAAAgAElEQVR4nO2dPas+T1rn+w0oCsKIg4gGPi1MM4PwF/4wgQgDEyyYTCBU4BhoNEYKi2NkcnrBhQU3mUhYMNBgOxA2WdAXoEa9si/BYEZEwbQ36K6q67Ge7r4fzjnfD4eZ/+++u6uqq7rr+tZ1XdX3tAPwHtiWeZqmaZrmZePfrGEShPU5bQQAgM/F9OwGAAAAAOBdAg0BAAAAgBFKGuK3f/u3vwEAAACAz82IhvjGN74hA80AAAAA+GQMaogQwn8Fn5Jf//Vfn6ZpnudnNwQAAMDT+IM/+INxDfHXf/3XhQPAB+b3fu/3pmn6zne+8+yGAAAAeBr/8A//AA0BuoGGAAAAAA0BRoCGAAAAAA0BRoCGAAAA8AE0xLbM+u2Enefj3YWddGoI9DEAAHxA7qchzncMz8ty/EfBgujXERNq8iC95bjdRKX65rct/wsmrgOpIdYQu/PgHJXzk64xSgdzMDwAAPBq3E9DHKZgXrZsUDw1cBgg+S0poMChAMRR5rKXKpX5bdu3ZZ7CGgt4G3dkfEa0HyKa/tSTa9KO50jqLjbEY1jF0e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AI0BAAAAGgIMAI0BAAAgJs0xB/90R/9L/Ap+da3vjVN05dffvnshgAAAHgaf/ZnfzauIbx36AAAAADgkzCiIQAAAAAAPKAhAAAAADACNAQAAAAARoCGAAAAAMAI0BAAAAAAGAEaAgAAAAAj/H9UExioEZB4EQAAAABJRU5ErkJggg==" alt="" width="463" height="181" />
5. 保存RichTextBox 对象中的文件
用SaveFile( )方法
(1)一般格式
RichTextBox对象名.SaveFile(文件名,文件类型);
(2)使用说明
同LoadSave( )方法。
//保存RTF格式文件
saveFileDialog1.Filter=
"RTF文件(*.rtf)|*.rtf"
; saveFileDialog1.DefaultExt=
"rtf"
;<br>
//默认的文件扩展名
if
(saveFileDialog1.ShowDialog()==DialogResult.OK)
richTextBox1.SaveFile(saveFileDialog1.FileName,RichTextBoxStreamType.RichText );
6. 插入图片文件
可借助剪贴板实现.
Clipboard.Clear();
//清空剪贴板
Bitmap bmp =
new
Bitmap(
@"d:\图片1.jpg"
);
//创建Bitmap类对象
Clipboard.SetImage(bmp);
//将Bitmap类对象写入剪贴板
richTextBox1.Paste();
//将剪贴板中的对象粘贴到RichTextBox1
7. 其它补充内容
TextBox控件用到的所有属性、事件和方法,RichTextBox控件几乎都能支持,例如 MaxLength、MultiLine、ScrollBars、SelLength、SelStart 和 SelText。
TextBoxBase.Undo 方法不可用于 KeyPress 或 TextChanged 事件。
RichTextBox 控件没有TextBox控件一样具有64K字符容量的限制。
RichTextBox 控件提供具有打开和保存文件的功能的方法。
LoadFile 方法使您得以将现有的 RTF 或 ASCII 文本文件加载到控件中。还可以从已打开的数据流加载数据。SaveFile 使您得以将文件保存到 RTF 或 ASCII 文本中。与 LoadFile 方法相似,还可以使用 SaveFile 方法保存到开放式数据流。
//部分文字属性的更改
public void CreateMyRichTextBox()
{
RichTextBox richTextBox1 = new RichTextBox();
richTextBox1.Dock = DockStyle.Fill; richTextBox1.LoadFile("C:\\MyDocument.rtf");
richTextBox1.Find("Text", RichTextBoxFinds.MatchCase); richTextBox1.SelectionFont = new Font("Verdana", 12, FontStyle.Bold);
richTextBox1.SelectionColor = Color.Red; richTextBox1.SaveFile("C:\\MyDocument.rtf", RichTextBoxStreamType.RichText); this.Controls.Add(richTextBox1);
}
public void CreateMyRichTextBox()
{
RichTextBox richTextBox1 = new RichTextBox();
richTextBox1.Dock = DockStyle.Fill; richTextBox1.LoadFile("C:\\MyDocument.rtf");
richTextBox1.Find("Text", RichTextBoxFinds.MatchCase); richTextBox1.SelectionFont = new Font("Verdana", 12, FontStyle.Bold);
richTextBox1.SelectionColor = Color.Red; richTextBox1.SaveFile("C:\\MyDocument.rtf", RichTextBoxStreamType.RichText); this.Controls.Add(richTextBox1);
}
例2
更加复杂的多媒体类型的文字段落的录入
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms; namespace Win_Test
{
public partial class RichTextBox_Test : Form
{
public RichTextBox_Test()
{
InitializeComponent();
} Font oldFont;
Font newFont; //richTextBox1 所选文字加粗
private void button1_Click(object sender, EventArgs e)
{
oldFont = this.richTextBox1.SelectionFont;
if (oldFont.Bold)
{
newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Bold);
}
else
{
newFont = new Font(oldFont, oldFont.Style | FontStyle.Bold);
}
this.richTextBox1.SelectionFont = newFont;
this.richTextBox1.Focus();
} //richTextBox1 所选文字加下划线
private void button2_Click(object sender, EventArgs e)
{
oldFont = this.richTextBox1.SelectionFont;
if (oldFont.Underline)
{
newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Underline);
}
else
{
newFont = new Font(oldFont, oldFont.Style | FontStyle.Underline);
}
this.richTextBox1.SelectionFont = newFont;
this.richTextBox1.Focus();
} //richTextBox1 所选文字为斜体
private void button3_Click(object sender, EventArgs e)
{
oldFont = this.richTextBox1.SelectionFont;
if (oldFont.Italic)
{
newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Italic);
}
else
{
newFont = new Font(oldFont, oldFont.Style | FontStyle.Italic);
}
this.richTextBox1.SelectionFont = newFont;
this.richTextBox1.Focus();
} //richTextBox1 所选文字居中
private void button4_Click(object sender, EventArgs e)
{
if (this.richTextBox1.SelectionAlignment == HorizontalAlignment.Center)
{
this.richTextBox1.SelectionAlignment = HorizontalAlignment.Left;
}
else
{
this.richTextBox1.SelectionAlignment = HorizontalAlignment.Center;
}
this.richTextBox1.Focus();
} // 在文本框输入字体大小
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
//remove all characters that are not numbers,backspace and enter
if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8 && e.KeyChar != 13)
{
e.Handled = true;
}
else if (e.KeyChar == 13)
{
TextBox txt = (TextBox)sender;
if (txt.Text.Length > 0)
ApplyTextSize(txt.Text);
e.Handled = true;
this.richTextBox1.Focus();
}
} //根据textBox1的值设置richTextBox1的字体
private void ApplyTextSize(string textSize)
{
float newSize = Convert.ToSingle(textSize);
FontFamily currentFontFamily;
Font newFont;
currentFontFamily = this.richTextBox1.SelectionFont.FontFamily;
newFont = new Font(currentFontFamily, newSize);
this.richTextBox1.SelectionFont = newFont;
} //在textBox1控件验证时触发,设置richTextBox1的字体
private void textBox1_Validating(object sender, CancelEventArgs e)
{
TextBox txt = (TextBox)sender;
ApplyTextSize(txt.Text);
this.richTextBox1.Focus();
} //让浏览器打开超链接地址
private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(e.LinkText);
} //richTextBox1 加载 Test.rtf 文件
private void button5_Click(object sender, EventArgs e)
{
try
{
richTextBox1.LoadFile("Test.rtf");
}
catch (System.IO.FileNotFoundException)
{
MessageBox.Show("No file to be load yet");
}
} //richTextBox1 保存到 Test.rtf 文件
private void button6_Click(object sender, EventArgs e)
{
try
{
richTextBox1.SaveFile("Test.rtf");
}
catch (System.Exception err)
{
MessageBox.Show(err.Message);
}
}
}
}
Demo using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms; namespace Win_Test
{
public partial class RichTextBox_Test : Form
{
public RichTextBox_Test()
{
InitializeComponent();
} Font oldFont;
Font newFont; //richTextBox1 所选文字加粗
private void button1_Click(object sender, EventArgs e)
{ oldFont = this.richTextBox1.SelectionFont;
if (oldFont.Bold)
{ newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Bold); }
else
newFont = new Font(oldFont, oldFont.Style | FontStyle.Bold); this.richTextBox1.SelectionFont = newFont;
this.richTextBox1.Focus(); } //richTextBox1 所选文字加下划线
private void button2_Click(object sender, EventArgs e)
{
oldFont = this.richTextBox1.SelectionFont;
if (oldFont.Underline)
{ newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Underline); }
else
newFont = new Font(oldFont, oldFont.Style | FontStyle.Underline);
this.richTextBox1.SelectionFont = newFont;
this.richTextBox1.Focus(); } //richTextBox1 所选文字为斜体
private void button3_Click(object sender, EventArgs e)
{
oldFont = this.richTextBox1.SelectionFont;
if (oldFont.Italic)
{ newFont = new Font(oldFont, oldFont.Style & ~FontStyle.Italic); }
else newFont = new Font(oldFont, oldFont.Style | FontStyle.Italic);
this.richTextBox1.SelectionFont = newFont;
this.richTextBox1.Focus();
} //richTextBox1 所选文字居中
private void button4_Click(object sender, EventArgs e)
{
if (this.richTextBox1.SelectionAlignment == HorizontalAlignment.Center)
this.richTextBox1.SelectionAlignment = HorizontalAlignment.Left;
else
this.richTextBox1.SelectionAlignment = HorizontalAlignment.Center;
this.richTextBox1.Focus();
} // 在文本框输入字体大小
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
//remove all characters that are not numbers,backspace and enter
if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8 && e.KeyChar != 13)
{ e.Handled = true; }
else if (e.KeyChar == 13)
{
TextBox txt = (TextBox)sender;
if (txt.Text.Length > 0)
ApplyTextSize(txt.Text);
e.Handled = true;
this.richTextBox1.Focus();
}
} //根据textBox1的值设置richTextBox1的字体
private void ApplyTextSize(string textSize)
{
float newSize = Convert.ToSingle(textSize);
FontFamily currentFontFamily;
Font newFont;
currentFontFamily = this.richTextBox1.SelectionFont.FontFamily;
newFont = new Font(currentFontFamily, newSize);
this.richTextBox1.SelectionFont = newFont;
} //在textBox1控件验证时触发,设置richTextBox1的字体
private void textBox1_Validating(object sender, CancelEventArgs e)
{
TextBox txt = (TextBox)sender;
ApplyTextSize(txt.Text);
this.richTextBox1.Focus();
} //让浏览器打开超链接地址
private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(e.LinkText);
} //richTextBox1 加载 Test.rtf 文件
private void button5_Click(object sender, EventArgs e)
{
try
{
richTextBox1.LoadFile("Test.rtf");
}
catch (System.IO.FileNotFoundException)
{
MessageBox.Show("No file to be load yet");
}
} //richTextBox1 保存到 Test.rtf 文件
private void button6_Click(object sender, EventArgs e)
{
try
{
richTextBox1.SaveFile("Test.rtf");
}
catch (System.Exception err)
{
MessageBox.Show(err.Message);
}
} }
}
(转)winform之RichTextBox的更多相关文章
- Winform下richtextbox截图实现
#region 根据richtextbox创建GDI+ private void DrawGDI(RichTextBox rich,Panel panl,PictureBox p2) { rich.U ...
- winform中RichTextBox在指定光标位置插入图片
代码如下: //获取RichTextBox控件中鼠标焦点的索引位置 int startPosition = this.richTextBox1.SelectionStart; //从鼠标焦点处开始选中 ...
- C#winform的Richtextbox控件实现自动滚动到最后一行功能
这里有两种情况 如果是采用的是richtextbox的AppendText的方法添加的内容,则只需 设置HideSelection为false 如果采用的是其他添加内容的方法,则需要添加TextCha ...
- C#Winform使用扩展方法自定义富文本框(RichTextBox)字体颜色
在利用C#开发Winform应用程序的时候,我们有可能使用RichTextBox来实现实时显示应用程序日志的功能,日志又分为:一般消息,警告提示 和错误等类别.为了更好地区分不同类型的日志,我们需要使 ...
- WinForm RichTextBox 常用操作
1.设置不自动选择字词 RichTextBox在选择文字的时候,如果没有关闭自动选择字词功能,我们有时候选择的时候会自动将光标前后的字或者词连接在一起进行选择. RichTextBox有属性AutoW ...
- (原创)WinForm中莫名其妙的小BUG——RichTextBox自动选择字词问题
一.前言 使用WinForm很久了,多多少少会遇到一些小BUG. 这些小BUG影响并不严重,而且稍微设置一下就能正常使用,而且微软一直也没有修复这些小BUG. 写本系列文章,是为了记录一下这些无伤大雅 ...
- WinForm richtextbox 关键字变红色
private void HilightRichText(RichTextBox control, string hilightString) { int nSel ...
- winform学习(8)RichTextBox控件
RichTextBox控件允许用户输入和编辑文本的同时提供了比普通的TextBox控件更高级的格式特征. RichTextBox的控件标识符.SelectionColor = Color.Blue; ...
- c# winform richtextbox控制每行颜色 + 滚动条始终滚动到最底部
/// <summary> /// 输出 /// </summary> /// <param name="content"></param ...
随机推荐
- 尚硅谷面试第一季-14Redis持久化类型及其区别
课堂重点: Redis提供了两种不同形式的持久化方案,分别是RDB和AOF. RDB使用Snapshot快照做全量的存储. RDB优缺点: AOF 以日志的方式记录每个写操作,只最佳,不该写文件.增量 ...
- WebSocket、Socket
https://www.cnblogs.com/jingmoxukong/p/7755643.html#undefined WebSocket 详解教程 WebSocket介绍,与Socket的区别 ...
- iOS Xcode Error 集锦
一),'libxml/tree.h' file not found Solution: 1. 导入libxml2.dylib 包 2.设置Header Search Paths 为 /usr/inc ...
- maven项目出现红色感叹号报错
背景 在eclipse部署maven项目的时候,项目出现红色的感叹号导致项目无法启动. 解决步骤 1.右键项目——>Maven——>Update Project ,弹出下框: 点击OK. ...
- Python3 tkinter基础 Listbox Button 点击按钮删除选中的单个元素
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- shell中使用echo输出时如何指定颜色
答: 请看下图:
- 【lg1799】数列
题目描述 虽然msh长大了,但她还是很喜欢找点游戏自娱自乐.有一天,她在纸上写了一串数字:1,l,2,5,4.接着她擦掉了一个l,结果发现剩下l,2,4都在自己所在的位置上,即1在第1位,2在第2位, ...
- bzoj1741 [Usaco2005 nov]Asteroids 穿越小行星群 最小点覆盖
链接 https://www.lydsy.com/JudgeOnline/problem.php?id=1741 思路 消除所有的小行星 每个点(x,y)只有选择x或者y才能被覆盖 二分图最小点覆盖= ...
- (转)mblog解读(一)
(二期)11.开源博客项目mblog解读(一) [课程11]图片上传模块.xmind54.6KB [课程11]消息发...通知.xmind55.2KB [课程11]异常处理分析.xmind95.4KB ...
- hihoCoder week16 RMQ-ST算法
RMQ问题 用的st表吧,读入数据挺多的,输出数据也挺多的 我还用了 cout<<endl; T了.. 真的是 做题不带脑子的 #include <bits/stdc++.h> ...