QCustomPlot是一个开源的基于Qt的第三方绘图库,能够绘制漂亮的2D图形。
QCustomPlot的官方网址:https://www.qcustomplot.com/
从官网下载QCustomPlot的源文件,包括qcustomplot.h和qcustomplot.cpp。
 
本程序的源码下载地址: https://github.com/xiongxw/XCustomPlot.git
 
 
1 自定义鼠标显示跟随类XxwTracer和XxwTraceLine:
XxwTracer用于在图表中显示鼠标所在位置的x,y值
XxwTraceLine用于在图中显示水平或垂直的虚线
头文件XxwTracer.h
  1. #ifndef MYTRACER_H
  2. #define MYTRACER_H
  3.  
  4. #include <QObject>
  5. #include "qcustomplot.h"
  6.  
  7. ///
  8. /// \brief The XxwTracer class:在图表中显示鼠标所在位置的x,y值的追踪显示器
  9. ///
  10. class XxwTracer : public QObject
  11. {
  12. Q_OBJECT
  13.  
  14. public:
  15. enum TracerType
  16. {
  17. XAxisTracer,//依附在x轴上显示x值
  18. YAxisTracer,//依附在y轴上显示y值
  19. DataTracer//在图中显示x,y值
  20. };
  21. explicit XxwTracer(QCustomPlot *_plot, TracerType _type, QObject *parent = Q_NULLPTR);
  22. ~XxwTracer();
  23. void setPen(const QPen &pen);
  24. void setBrush(const QBrush &brush);
  25. void setText(const QString &text);
  26. void setLabelPen(const QPen &pen);
  27. void updatePosition(double xValue, double yValue);
  28. void setVisible(bool m_visible);
  29.  
  30. protected:
  31. bool m_visible;//是否可见
  32. TracerType m_type;//类型
  33. QCustomPlot *m_plot;//图表
  34. QCPItemTracer *m_tracer;//跟踪的点
  35. QCPItemText *m_label;//显示的数值
  36. QCPItemLine *m_arrow;//箭头
  37. };
  38.  
  39. ///
  40. /// \brief The XxwCrossLine class:用于显示鼠标移动过程中的鼠标位置的直线
  41. ///
  42. class XxwTraceLine : public QObject
  43. {
  44. public:
  45. enum LineType
  46. {
  47. VerticalLine,//垂直线
  48. HorizonLine, //水平线
  49. Both//同时显示水平和垂直线
  50. };
  51. explicit XxwTraceLine(QCustomPlot *_plot, LineType _type = VerticalLine, QObject *parent = Q_NULLPTR);
  52. ~XxwTraceLine();
  53. void initLine();
  54. void updatePosition(double xValue, double yValue);
  55.  
  56. void setVisible(bool vis)
  57. {
  58. if(m_lineV)
  59. m_lineV->setVisible(vis);
  60. if(m_lineH)
  61. m_lineH->setVisible(vis);
  62. }
  63.  
  64. protected:
  65. bool m_visible;//是否可见
  66. LineType m_type;//类型
  67. QCustomPlot *m_plot;//图表
  68. QCPItemStraightLine *m_lineV; //垂直线
  69. QCPItemStraightLine *m_lineH; //水平线
  70. };
  71.  
  72. #endif // MYTRACER_H

源文件MyTracer.cpp

  1. #include "MyTracer.h"
  2.  
  3. XxwTracer::XxwTracer(QCustomPlot *_plot, TracerType _type, QObject *parent)
  4. : QObject(parent),
  5. m_plot(_plot),
  6. m_type(_type)
  7. {
  8. m_visible = true;
  9. m_tracer = Q_NULLPTR;// 跟踪的点
  10. m_label = Q_NULLPTR;// 显示的数值
  11. m_arrow = Q_NULLPTR;// 箭头
  12. if (m_plot)
  13. {
  14. QColor clrDefault(Qt::red);
  15. QBrush brushDefault(Qt::NoBrush);
  16. QPen penDefault(clrDefault);
  17. // penDefault.setBrush(brushDefault);
  18. penDefault.setWidthF(0.5);
  19.  
  20. m_tracer = new QCPItemTracer(m_plot);
  21. m_tracer->setStyle(QCPItemTracer::tsCircle);
  22. m_tracer->setPen(penDefault);
  23. m_tracer->setBrush(brushDefault);
  24.  
  25. m_label = new QCPItemText(m_plot);
  26. m_label->setLayer("overlay");
  27. m_label->setClipToAxisRect(false);
  28. m_label->setPadding(QMargins(, , , ));
  29. m_label->setBrush(brushDefault);
  30. m_label->setPen(penDefault);
  31. m_label->position->setParentAnchor(m_tracer->position);
  32. // m_label->setFont(QFont("宋体", 8));
  33. m_label->setFont(QFont("Arial", ));
  34. m_label->setColor(clrDefault);
  35. m_label->setText("");
  36.  
  37. m_arrow = new QCPItemLine(m_plot);
  38. QPen arrowPen(clrDefault, );
  39. m_arrow->setPen(penDefault);
  40. m_arrow->setLayer("overlay");
  41. m_arrow->setClipToAxisRect(false);
  42. m_arrow->setHead(QCPLineEnding::esSpikeArrow);//设置头部为箭头形状
  43.  
  44. switch (m_type)
  45. {
  46. case XAxisTracer:
  47. {
  48. m_tracer->position->setTypeX(QCPItemPosition::ptPlotCoords);
  49. m_tracer->position->setTypeY(QCPItemPosition::ptAxisRectRatio);
  50. m_tracer->setSize();
  51. m_label->setPositionAlignment(Qt::AlignTop | Qt::AlignHCenter);
  52.  
  53. m_arrow->end->setParentAnchor(m_tracer->position);
  54. m_arrow->start->setParentAnchor(m_arrow->end);
  55. m_arrow->start->setCoords(, );//偏移量
  56. break;
  57. }
  58. case YAxisTracer:
  59. {
  60. m_tracer->position->setTypeX(QCPItemPosition::ptAxisRectRatio);
  61. m_tracer->position->setTypeY(QCPItemPosition::ptPlotCoords);
  62. m_tracer->setSize();
  63. m_label->setPositionAlignment(Qt::AlignRight | Qt::AlignHCenter);
  64.  
  65. m_arrow->end->setParentAnchor(m_tracer->position);
  66. m_arrow->start->setParentAnchor(m_label->position);
  67. m_arrow->start->setCoords(-, );//偏移量
  68. break;
  69. }
  70. case DataTracer:
  71. {
  72. m_tracer->position->setTypeX(QCPItemPosition::ptPlotCoords);
  73. m_tracer->position->setTypeY(QCPItemPosition::ptPlotCoords);
  74. m_tracer->setSize();
  75.  
  76. m_label->setPositionAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  77.  
  78. m_arrow->end->setParentAnchor(m_tracer->position);
  79. m_arrow->start->setParentAnchor(m_arrow->end);
  80. m_arrow->start->setCoords(, );
  81. break;
  82. }
  83. default:
  84. break;
  85. }
  86. setVisible(false);
  87. }
  88. }
  89.  
  90. XxwTracer::~XxwTracer()
  91. {
  92. if(m_plot)
  93. {
  94. if (m_tracer)
  95. m_plot->removeItem(m_tracer);
  96. if (m_label)
  97. m_plot->removeItem(m_label);
  98. if (m_arrow)
  99. m_plot->removeItem(m_arrow);
  100. }
  101. }
  102.  
  103. void XxwTracer::setPen(const QPen &pen)
  104. {
  105. if(m_tracer)
  106. m_tracer->setPen(pen);
  107. if(m_arrow)
  108. m_arrow->setPen(pen);
  109. }
  110.  
  111. void XxwTracer::setBrush(const QBrush &brush)
  112. {
  113. if(m_tracer)
  114. m_tracer->setBrush(brush);
  115. }
  116.  
  117. void XxwTracer::setLabelPen(const QPen &pen)
  118. {
  119. if(m_label)
  120. {
  121. m_label->setPen(pen);
  122. m_label->setBrush(Qt::NoBrush);
  123. m_label->setColor(pen.color());
  124. }
  125. }
  126.  
  127. void XxwTracer::setText(const QString &text)
  128. {
  129. if(m_label)
  130. m_label->setText(text);
  131. }
  132.  
  133. void XxwTracer::setVisible(bool vis)
  134. {
  135. m_visible = vis;
  136. if(m_tracer)
  137. m_tracer->setVisible(m_visible);
  138. if(m_label)
  139. m_label->setVisible(m_visible);
  140. if(m_arrow)
  141. m_arrow->setVisible(m_visible);
  142. }
  143.  
  144. void XxwTracer::updatePosition(double xValue, double yValue)
  145. {
  146. if (!m_visible)
  147. {
  148. setVisible(true);
  149. m_visible = true;
  150. }
  151.  
  152. if (yValue > m_plot->yAxis->range().upper)
  153. yValue = m_plot->yAxis->range().upper;
  154.  
  155. switch (m_type)
  156. {
  157. case XAxisTracer:
  158. {
  159. m_tracer->position->setCoords(xValue, );
  160. m_label->position->setCoords(, );
  161. m_arrow->start->setCoords(, );
  162. m_arrow->end->setCoords(, );
  163. setText(QString::number(xValue));
  164. break;
  165. }
  166. case YAxisTracer:
  167. {
  168. m_tracer->position->setCoords(, yValue);
  169. m_label->position->setCoords(-, );
  170. // m_arrow->start->setCoords(20, 0);
  171. // m_arrow->end->setCoords(0, 0);
  172. setText(QString::number(yValue));
  173. break;
  174. }
  175. case DataTracer:
  176. {
  177. m_tracer->position->setCoords(xValue, yValue);
  178. m_label->position->setCoords(, );
  179. setText(QString("x:%1,y:%2").arg(xValue).arg(yValue));
  180. break;
  181. }
  182. default:
  183. break;
  184. }
  185. }
  186.  
  187. XxwTraceLine::XxwTraceLine(QCustomPlot *_plot, LineType _type, QObject *parent)
  188. : QObject(parent),
  189. m_type(_type),
  190. m_plot(_plot)
  191. {
  192. m_lineV = Q_NULLPTR;
  193. m_lineH = Q_NULLPTR;
  194. initLine();
  195. }
  196.  
  197. XxwTraceLine::~XxwTraceLine()
  198. {
  199. if(m_plot)
  200. {
  201. if (m_lineV)
  202. m_plot->removeItem(m_lineV);
  203. if (m_lineH)
  204. m_plot->removeItem(m_lineH);
  205. }
  206. }
  207.  
  208. void XxwTraceLine::initLine()
  209. {
  210. if(m_plot)
  211. {
  212. QPen linesPen(Qt::red, , Qt::DashLine);
  213.  
  214. if(VerticalLine == m_type || Both == m_type)
  215. {
  216. m_lineV = new QCPItemStraightLine(m_plot);//垂直线
  217. m_lineV->setLayer("overlay");
  218. m_lineV->setPen(linesPen);
  219. m_lineV->setClipToAxisRect(true);
  220. m_lineV->point1->setCoords(, );
  221. m_lineV->point2->setCoords(, );
  222. }
  223.  
  224. if(HorizonLine == m_type || Both == m_type)
  225. {
  226. m_lineH = new QCPItemStraightLine(m_plot);//水平线
  227. m_lineH->setLayer("overlay");
  228. m_lineH->setPen(linesPen);
  229. m_lineH->setClipToAxisRect(true);
  230. m_lineH->point1->setCoords(, );
  231. m_lineH->point2->setCoords(, );
  232. }
  233. }
  234. }
  235.  
  236. void XxwTraceLine::updatePosition(double xValue, double yValue)
  237. {
  238. if(VerticalLine == m_type || Both == m_type)
  239. {
  240. if(m_lineV)
  241. {
  242. m_lineV->point1->setCoords(xValue, m_plot->yAxis->range().lower);
  243. m_lineV->point2->setCoords(xValue, m_plot->yAxis->range().upper);
  244. }
  245. }
  246.  
  247. if(HorizonLine == m_type || Both == m_type)
  248. {
  249. if(m_lineH)
  250. {
  251. m_lineH->point1->setCoords(m_plot->xAxis->range().lower, yValue);
  252. m_lineH->point2->setCoords(m_plot->xAxis->range().upper, yValue);
  253. }
  254. }
  255. }
2 自定义的图表类XCustomPlot
XCustomPlot是基于QCustomPlot二次开发的图表类,在鼠标移动过程中动态显示曲线上点的值。
头文件XCustomPlot.h
  1. #ifndef XCUSTOMPLOT_H
  2. #define XCUSTOMPLOT_H
  3.  
  4. #include "XxwTracer.h"
  5. #include "qcustomplot.h"
  6. #include <QObject>
  7. #include <QList>
  8.  
  9. class XxwCustomPlot:public QCustomPlot
  10. {
  11. Q_OBJECT
  12.  
  13. public:
  14. XxwCustomPlot(QWidget *parent = );
  15.  
  16. protected:
  17. virtual void mouseMoveEvent(QMouseEvent *event);
  18.  
  19. public:
  20. ///
  21. /// \brief 设置是否显示鼠标追踪器
  22. /// \param show:是否显示
  23. ///
  24. void showTracer(bool show)
  25. {
  26. m_isShowTracer = show;
  27. if(m_xTracer)
  28. m_xTracer->setVisible(m_isShowTracer);
  29. foreach (XxwTracer *tracer, m_dataTracers)
  30. {
  31. if(tracer)
  32. tracer->setVisible(m_isShowTracer);
  33. }
  34. if(m_lineTracer)
  35. m_lineTracer->setVisible(m_isShowTracer);
  36. }
  37.  
  38. ///
  39. /// \brief 是否显示鼠标追踪器
  40. /// \return
  41. ///
  42. bool isShowTracer(){return m_isShowTracer;};
  43.  
  44. private:
  45. bool m_isShowTracer;//是否显示追踪器(鼠标在图中移动,显示对应的值)
  46. XxwTracer *m_xTracer;//x轴
  47. XxwTracer *m_yTracer;//y轴
  48. QList<XxwTracer *> m_dataTracers;//
  49. XxwTraceLine *m_lineTracer;//直线
  50. };
  51.  
  52. #endif // XCUSTOMPLOT_H

源文件XCustomPlot.h

  1. #include "XxwCustomPlot.h"
  2.  
  3. XxwCustomPlot::XxwCustomPlot(QWidget *parent)
  4. :QCustomPlot(parent)
  5. ,m_isShowTracer(false)
  6. ,m_xTracer(Q_NULLPTR)
  7. ,m_yTracer(Q_NULLPTR)
  8. ,m_dataTracers(QList<XxwTracer *>())
  9. ,m_lineTracer(Q_NULLPTR)
  10. {
  11. }
  12.  
  13. void XxwCustomPlot::mouseMoveEvent(QMouseEvent *event)
  14. {
  15. QCustomPlot::mouseMoveEvent(event);
  16.  
  17. if(m_isShowTracer)
  18. {
  19. //当前鼠标位置(像素坐标)
  20. int x_pos = event->pos().x();
  21. int y_pos = event->pos().y();
  22.  
  23. //像素坐标转成实际的x,y轴的坐标
  24. float x_val = this->xAxis->pixelToCoord(x_pos);
  25. float y_val = this->yAxis->pixelToCoord(y_pos);
  26.  
  27. if(Q_NULLPTR == m_xTracer)
  28. m_xTracer = new XxwTracer(this, XxwTracer::XAxisTracer);//x轴
  29. m_xTracer->updatePosition(x_val, y_val);
  30.  
  31. if(Q_NULLPTR == m_yTracer)
  32. m_yTracer = new XxwTracer(this, XxwTracer::YAxisTracer);//y轴
  33. m_yTracer->updatePosition(x_val, y_val);
  34.  
  35. int nTracerCount = m_dataTracers.count();
  36. int nGraphCount = graphCount();
  37. if(nTracerCount < nGraphCount)
  38. {
  39. for(int i = nTracerCount; i < nGraphCount; ++i)
  40. {
  41. XxwTracer *tracer = new XxwTracer(this, XxwTracer::DataTracer);
  42. m_dataTracers.append(tracer);
  43. }
  44. }
  45. else if(nTracerCount > nGraphCount)
  46. {
  47. for(int i = nGraphCount; i < nTracerCount; ++i)
  48. {
  49. XxwTracer *tracer = m_dataTracers[i];
  50. if(tracer)
  51. {
  52. tracer->setVisible(false);
  53. }
  54. }
  55. }
  56. for (int i = ; i < nGraphCount; ++i)
  57. {
  58. XxwTracer *tracer = m_dataTracers[i];
  59. if(!tracer)
  60. tracer = new XxwTracer(this, XxwTracer::DataTracer);
  61. tracer->setVisible(true);
  62. tracer->setPen(this->graph(i)->pen());
  63. tracer->setBrush(Qt::NoBrush);
  64. tracer->setLabelPen(this->graph(i)->pen());
  65. auto iter = this->graph(i)->data()->findBegin(x_val);
  66. double value = iter->mainValue();
  67. // double value = this->graph(i)->data()->findBegin(x_val)->value;
  68. tracer->updatePosition(x_val, value);
  69. }
  70.  
  71. if(Q_NULLPTR == m_lineTracer)
  72. m_lineTracer = new XxwTraceLine(this,XxwTraceLine::Both);//直线
  73. m_lineTracer->updatePosition(x_val, y_val);
  74.  
  75. this->replot();//曲线重绘
  76. }
  77. }

3 使用自定义图表类XCustomPlot

在需要绘图的地方使用,代码如下:

  1. m_customPlot = new XxwCustomPlot();
  2. m_customPlot->showTracer(true);
  3.  
  4. // add title layout element:
  5. m_customPlot->plotLayout()->insertRow();
  6. m_customPlot->plotLayout()->addElement(, , new QCPTextElement(m_customPlot, "标题", QFont("黑体", , QFont::Bold)));
  7.  
  8. m_customPlot->legend->setVisible(true);
  9. QFont legendFont = font(); // start out with MainWindow's font..
  10. legendFont.setPointSize(); // and make a bit smaller for legend
  11. m_customPlot->legend->setFont(legendFont);
  12. m_customPlot->legend->setBrush(QBrush(QColor(,,,)));
  13. // by default, the legend is in the inset layout of the main axis rect. So this is how we access it to change legend placement:
  14. m_customPlot->axisRect()->insetLayout()->setInsetAlignment(, Qt::AlignTop|Qt::AlignCenter);
  15.  
  16. // make left and bottom axes always transfer their ranges to right and top axes:
  17. connect(m_customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), m_customPlot->xAxis2, SLOT(setRange(QCPRange)));
  18. connect(m_customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), m_customPlot->yAxis2, SLOT(setRange(QCPRange)));
  19.  
  20. // Allow user to drag axis ranges with mouse, zoom with mouse wheel and select graphs by clicking:
  21. m_customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);
  22.  
  23. // generate some data:
  24. int nCount = ;
  25. QVector<double> x(nCount), y0(nCount), y1(nCount); // initialize with entries 0..100
  26. for (int i = ; i < nCount; ++i)
  27. {
  28. x[i] = i; // x goes from -1 to 1
  29. y0[i] = qSin(i * 10.0f / nCount); //sin
  30. y1[i] = qCos(i * 10.0f / nCount); //cos
  31. }
  32. // create graph and assign data to it:
  33. QPen pen;
  34. int i = ;
  35. QCPGraph *pGraph = m_customPlot->addGraph();
  36. // m_customPlot->graph(0)->setData(x, y0);
  37. pGraph->setName("sin曲线");
  38. pGraph->setData(x,y0);
  39. pGraph->setPen(QPen(Qt::blue));
  40.  
  41. pGraph = m_customPlot->addGraph();
  42. // m_customPlot->graph(0)->setData(x, y0);
  43. pGraph->setName("cos曲线");
  44. pGraph->setData(x,y1);
  45. pGraph->setPen(QPen(Qt::darkYellow));
  46.  
  47. // give the axes some labels:
  48. m_customPlot->xAxis->setLabel("x");
  49. m_customPlot->yAxis->setLabel("y");
  50.  
  51. // set axes ranges, so we see all data:
  52. // m_customPlot->xAxis->setRange(-1, 1);
  53. // m_customPlot->yAxis->setRange(0, 1);
  54. m_customPlot->rescaleAxes(true);
  55.  
  56. m_customPlot->replot();

4 效果图

本程序的源码下载地址: https://github.com/xiongxw/XCustomPlot.git

采用Qt快速绘制多条曲线(折线),跟随鼠标动态显示线上点的值(基于Qt的开源绘图控件QCustomPlot进行二次开发)的更多相关文章

  1. qt超强精美绘图控件 - QCustomPlot一览 及 安装使用教程

    1.概述 QCustomPlot 是一个超强超小巧的qt绘图类,非常漂亮,非常易用,只需要加入一个qcustomplot.h和qcustomplot.cpp文件即可使用,远比qwt方便和漂亮,可以自己 ...

  2. paper 139:qt超强绘图控件qwt - 安装及配置

    qwt是一个基于LGPL版权协议的开源项目, 可生成各种统计图.它为具有技术专业背景的程序提供GUI组件和一组实用类,其目标是以基于2D方式的窗体部件来显示数据, 数据源以数值,数组或一组浮点数等方式 ...

  3. C# Charts绘制多条曲线

    一.创建winform工程 拖拽控件Chart 二.比如要绘制俩条曲线,设置Chart控件的属性Series 三.chart的属性根据自己的业务需求设计,我这里只设置了图标类型 代码: using S ...

  4. VS2010 使用TeeChart绘图控件 - 之二 - 绘制图形(折线图,柱状图)

    1.前期准备 具体可见VS2010 使用TeeChart绘图控件 - 之一 控件和类的导入 1. 1 添加TeeChart控件,给控件添加变量m_TeeChart 添加TeeChart控件,右击控件, ...

  5. qt超强绘图控件qwt - 安装及配置

    qwt是一个基于LGPL版权协议的开源项目, 可生成各种统计图.它为具有技术专业背景的程序提供GUI组件和一组实用类,其目标是以基于2D方式的窗体部件来显示数据, 数据源以数值,数组或一组浮点数等方式 ...

  6. MSChart绘图控件中折线图和柱形图画法

    首先在前台拖入一个名为chart1的MSChart控件 //折线图 string strLegend = "Legend1"; Legend lg = new Legend(str ...

  7. 使用C#三维绘图控件快速搭建DXF查看程序

    本例使用AnyCAD .Net三维图形控件快速实现一个DXF文件的读取.显示.导出JPG.PNG.PDF的应用. 代码: using System; using System.Collections. ...

  8. Qt绘图控件qwt绘制等比例坐标图

    需要用到QwtPlotRescaler类,用法如下: QwtPlotRescaler *plotRescaler = new QwtPlotRescaler(canvas, yLeft, QwtPlo ...

  9. C#.NET常见问题(FAQ)-如何使用2D绘图控件ZedGraph绘制坐标轴和坐标曲线

    添加数据:示例添加了一条sin曲线和一条cos曲线,注意cos曲线比sin曲线点更密集(可以用这种方式控制点的采样疏密程度)   默认显示效果如下图所示,可以框选一个部分看放大效果   右击某个点可以 ...

随机推荐

  1. 《Image-to-Image Translation with Conditional Adversarial Networks》论文笔记

    出处 CVPR2017 Motivation 尝试用条件GAN网络来做image translation,让网络自己学习图片到图片的映射函数,而不需要人工定制特征. Introduction 作者从不 ...

  2. VScode相关

    这就是我想要的 VSCode 插件! VS Code 快捷键(中英文对照版) visual studio code 配置vue开发环境 vscode 这样的注释怎么生成? 能让你开发效率翻倍的 VSC ...

  3. bzoj 2754: [SCOI2012]喵星球上的点名【AC自动机】

    洛谷90,最后一个点死活卡不过去(也可能是我写的有问题? 比较暴力的做法,把询问带着标号建立AC自动机,用map存儿子. 然后用名字串在自动机上跑,以为是名或姓的子串就行所以把名和姓中间加个特殊字符拼 ...

  4. POJ 2259 Team Queue(队列)

    题目原网址:http://poj.org/problem?id=2259 题目中文翻译: Description 队列和优先级队列是大多数计算机科学家已知的数据结构. 然而,Team Queue并不是 ...

  5. [Usaco2011 Feb]Generic Cow Protests

    Description Farmer John's N (1 <= N <= 100,000) cows are lined up in a row and numbered 1..N. ...

  6. [USACO 2012 Jan Silver] Bale Share【DP】

    传送门:http://www.usaco.org/index.php?page=viewproblem2&cpid=107 没想到太不应该了,真的不应该啊! f[i][j][k]表示前i个包, ...

  7. 题解报告:hdu 1236 排名

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1236 Problem Description 今天的上机考试虽然有实时的Ranklist,但上面的排名 ...

  8. ATM机(非函数版)

    #include<stdio.h>#include<stdlib.h>int main(void){char zhangHao[]="123";int mi ...

  9. ES6知识点汇总

    MDN镇楼: https://developer.mozilla.org/zh-CN/ 1.ES6新添加数据类型:symbol  -----------   https://developer.moz ...

  10. c# 搜狗拼音输入法,刷输入速度和累计输入

    事件起因: 搜狗拼音有几个称号(光速超人:要求最快打字速度 200字/m,一代文豪:要求累计输入字数达200000)一直没有那么快的速度,就想用.net来实现. 相关技术: 1.winform基本控件 ...