全部文章
indent是linux下一个能力极强的代码整理软件,使用他,可以轻松的写出代码风格十分精良的代码。
但是indent的参数太多,使用起来不是很容易,怎么办呢?
查看
/usr/src/linux-headers-/scripts/Lindent
文件 ,可以看到一行代码:
indent -npro -kr -i8 -ts8 -sob -l80...
解题报告
题意:
求矩形周长和。
思路:
左扫上扫,扫过了。
#include
#include
#include
#include
#include
using namespace std;
struct Seg {
int lx,rx,ly,ry,h,v;
friend bool operator < (Seg a,Seg b)
{
...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2089
思路:用变量记录吉利数,和最高位为2的吉利数还有不是吉利数的个数。。。
code:
#include
#include
#include
using namespace std;
int dp[10][3]; //dp[i][j] ,i表示位数,j表示状态//dp[i...
Problem Description
FSF has programmed a game.
In this game, players need to divide a rectangle into several same squares.
The length and width of rectangles are integer, and of course the side len...
C++引入了ostringstream、istringstream、stringstream这三个类,要使用他们创建对象就必须包含sstream.h头文件。
istringstream类用于执行C++风格的串流的输入操作。
ostringstream类用于执行C风格的串流的输出操作。
strstream类同时可以支持C风格的串流的输入输出操作。
istringstre...
opencv对图像进行边缘及角点检测
先看结果:
代码:
// ConsoleApplication1_812.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "opencv2/opencv.hpp"
class Imagedetector{
...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3555
题目大意:就是给你一个数n,判断从0到n有多少个数含有数字49.。。。。。
是不是觉得跟hdu2089很相似呀。。。
思路:跟hdu2089一样的,注意给出的数比较大,所以这儿用__int64 。。。。
code:
#include
#incl...
职责链模式(Chain of Responsibility):使多个对象都有机会处理请求,从而避免请求的发送者和接收者之间的耦合关系。将这个对象连成一条链,并沿着该条链传递该请求,直到有一个对象处理它为止。
(1),当客户提交一个请求时,请求时沿着链传递直到有一个 ConcreteHandler 对象负责处理它。
(2),接收者和发送者都没有对方的明确信息,切链中的对象自己也不知道链的...