自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

咸鱼

做正直的人,做诚实的学问。

  • 博客(48)
  • 收藏
  • 关注

原创 vs2015+opencv3.2.0+contrib+cuda8.0

以前安装过cuda7.5,但是一直不是刚需,没把cuda跟opencv结合起来,就一直放在那没动。 这次做匹配实验实在嫌速度太慢,准备弄下opencv的gpu加速版。 网上有好多教程,发现自己仍需放肆修炼,搭建过程遇到挺多问题的,感觉别的博主都轻轻松松啊- -!在这里记录下这次搭建过程,纪念这光阴流逝的三天= =! 1,控制面板完全卸载原cuda7.5,彻彻底底,完完全全!!后面安装cuda...

2018-07-15 16:54:49 965

原创 opencv读取文件路径文件名

我主要是用这个代码读取单级目录文件夹下.jpg格式的图片,并获取文件的绝对路径。 内容参考了OpenCV 应用读取文件路径与文件名批量处理图片#include <iostream>#include <io.h>#include <opencv2/features2d.hpp>#include <opencv2/xfeatures2d/nonfr

2018-07-11 16:00:49 4370

原创 opencv3.x遍历文件夹读取图片

#include <opencv2\opencv.hpp>#include <iostream>using namespace std;using namespace cv;int main(){ //用void glob(String pattern, std::vector<String>& result, bool recursive = false);当recursive为f

2017-11-30 17:59:07 6619 3

原创 opencv截取视频图片保存

#include <opencv2/opencv.hpp>#include <iostream>using namespace std;using namespace cv;int main(){ VideoCapture capture("E:\\videos\\bdb.mp4"); //设置开始帧() int frameToStart = 0; //设

2017-10-08 17:51:50 1754

转载 杭电acm2041:递归楼梯

#include <iostream>using namespace std;int main(){ int n; cin >> n; while (n){ int M; cin >> M; long int a[40]; a[0] = 0; a[1] = 1; for (in

2017-09-29 10:16:09 421

原创 杭电acm2039:给三边长判断能不能构成三角形

很坑很坑,数据类型不能是int,不能是int,int….. 我还以为两边和大于第三边这个思路(两边差小于第三边,这两个只要考虑一个就可以了)是错的,错的,错的! 还记得某次上机考试也是考的这个,血亏血亏血亏!!!!!#include <iostream>using namespace std;struct trig{ double a; double b; doubl

2017-09-23 10:25:47 1016 1

原创 杭电acm2037:尽可能多的看电视节目

思路:将电视节目按结束时间从小到大排列,越早结束,越能看更多的节目; 以结束时间顺序找上个节目结束后能开始的节目,统计个数; 额,好像是贪心算法的一个简单题,没到那个层次,作为小白的我任重而道远啊- -!。#include <iostream>using namespace std;struct program{ int start_time; int end_time;}

2017-09-23 10:17:03 1197

原创 杭电acm2036:凹凸多边形面积

不能用劳伦公式求面积,没有考虑到凹多边形的情况。 以原点为三角形一个顶点,找多边形上逆时针相方向邻的两个点为依次为三角形的另两个顶点,用叉乘法求三角形面积。 叉乘求面积是有方向,即正负的,但逆时针选点所求面积为正。 逆时针选点的终点为首尾相连。#include <iostream>using namespace std;struct points{ int x; int y

2017-09-20 23:41:42 1349

原创 杭电acm2040:亲和数(两整数真约数和互等)

开始没明白真约数是啥- -!贼简单。#include <iostream>using namespace std;int find_sum(int& n){ int k = n; int sum = 1; for (int i = 2; i <k; i++){ if (k % i == 0){ sum += i; }

2017-09-20 23:16:00 534

原创 杭电ACM2035:人见人爱A^B

其实是个很简单的题目,我自己把自己绕进去了,以为要实现大数相乘,然后保留下后三位数- -! 题目要求保留最后三位数,那就只求最后三位数跟大数的乘积 看网上高端的说法是 同余定理 数论里面的概念 有点绕- -! 额,顺带说下,这道题好像是道挺水的题,有写这道题的博客都好少- -!#include <iostream>using namespace std;int main(){ i

2017-09-17 21:50:55 550

原创 main函数参数argc和argv应用

argc和argv参数需要从cmd中输入实例1:#include <iostream>#include <fstream>using namespace std;int main(int argc, char* argv[]){ if (argc != 3)//输入参数必须为三个,第一个为生成程序名,第二个为输入文件的路径,第三个为输出文件的路径 { cout

2017-09-08 16:32:21 385

原创 杭电ACM:人见人爱A-B

//A集合相对于B集合的差集#include <iostream>using namespace std;int main(){ int A[100], B[100], C[100]; int n, m; //第一次提交,(n != 0 && m != 0),&& 和 || 一段时间不用不记得- - while (cin >> n >> m && (n != 0

2017-08-09 00:39:56 2097

原创 文件流infile读取数据

//读取文件数据#include <iostream>#include <string>#include <fstream>using namespace std;int main(){ string b[100]; string file_path = "D:\\P1.txt"; //cout << file << endl; ifstream infile

2017-07-12 17:26:04 13298

原创 杭电ACM2033:A+B

#include <iostream>using namespace std;int main(){ int n; int ah, am, as, bh, bm, bs; int s, m, h; cin >> n; while (n--){ cin >> ah >> am >> as >> bh >> bm >> bs;

2017-06-09 17:24:52 440

原创 杭电ACM2032:杨辉三角

#include <iostream>using namespace std;int main(){ int n; int a[30][30]; while (cin >> n){ for (int i = 0; i < n; i++){ a[i][0] = 1; a[i][i] = 1; }

2017-06-05 15:12:40 445

原创 杭电ACM2031:进制转换

#include <iostream>using namespace std;int main(){ int N, R; while (cin >> N >> R){ int a[10], i = 0, flag = 0; int x = N, y; //考虑负值 if (x < 0){ x

2017-05-23 16:19:50 1240

原创 杭电ACM2030:字符串汉字统计

#include <iostream>#include <string>using namespace std;int main(){ int n; cin >> n; getchar(); while (n--){ string str; int num = 0; getline(cin, str);

2017-05-18 16:43:15 913

原创 杭电ACM2029:回文判断简单版

#include<iostream>#include<string>using namespace std;int main(){ int n, length; string str; cin >> n; getchar(); while (n){ int num = 0; getline(cin, str);

2017-05-17 17:22:05 451

原创 杭电ACM2028:最小公倍数

#include <iostream>using namespace std;int main(){ int n; int a[100]; int x, y, r; int gcd; //greatest common divisor int lcmp; //least common multiple while (cin >> n)

2017-05-17 16:51:50 718

原创 杭电ACM2027:统计元音

#include <iostream>#include <string>using namespace std;int main(){ int n; cin >> n; getchar(); while (n--){ string str; getline(cin, str); int length = str.l

2017-05-15 14:09:56 329

原创 杭电ACM2026:首字母大写

#include<iostream>#include<string>using namespace std;int main(){ string str; while (getline(cin, str)){ int length = str.length(); //第一个字符是小写就要转换 if (str[0] >= 'a' &

2017-05-15 13:37:29 1044

原创 杭电ACM2025:查找最大元素

#include <iostream>#include <string>using namespace std;int main(){ string str; while (getline(cin, str)){ string str2 = str; int length = str.length(); char c = 'a';

2017-05-14 18:53:42 376

原创 杭电ACM2024:C合法标识符

#include <iostream>#include <string>using namespace std;int main(){ int n, flag = 0,length; string a; cin >> n; getchar(); while (n){ getline(cin, a); length = a.

2017-05-14 17:23:15 877

原创 opencv2.x遍历文件夹改变图像分辨率并保存

#include <iostream>#include <opencv2/opencv.hpp>using namespace std;using namespace cv;int main(){ string mofang_path = "D:\\A-codes\\mofang\\"; Directory dir; vector<string>fileNames =

2017-05-13 16:17:36 462

原创 杭电ACM2022:海选女主角

#include <iostream>using namespace std;int main(){ int n, m; while (cin >> m >> n){ signed int a[100][100]; signed int max = 0; int x, y; //输入m*n数据 for

2017-05-04 16:08:38 458

原创 杭电ACM2021:发工资

#include <iostream>using namespace std;int main(){ int n, s = 0; int a[100]; while (cin >> n && n){ for (int i = 0; i < n; i++){ cin >> a[i]; s += a[i] / 1

2017-04-25 15:53:03 494

原创 杭电ACM2020:绝对值排序

#include <iostream>using namespace std;int main(){ int n,t; int a[100]; while (cin >> n && n != 0){ for (int i = 0; i < n; i++) cin >> a[i]; //感觉就是“冒泡”排序吧,第一轮第一

2017-04-24 17:29:45 701

原创 杭电ACM2019:数列有序

#include <iostream>using namespace std;int main(){ int n, m,t; int a[100]; //双0结束,这里讲实话有点迷,“或,且”,里面的括号不要也可以AC,有点懒不想去找东西看,先放着。 while (cin >> n >> m && (n != 0 || m != 0)){ for

2017-04-24 16:51:57 773

原创 杭电ACM2018:母牛递增

#include <iostream>using namespace std;//开始错误的递归想法,f(n)=n,n<=4;f(n)=f(n-1)+n-3,n>4;//正确的递归应该是这样的:f(n)=f(n-1)+第n年新母牛数,而第n年只有第n-3年的母牛能生母牛,即f(n)=f(n-1)+f(n-3)。int f(const int x){ int y = x,s;

2017-04-20 16:41:24 408

原创 杭电ACM2017:字符串统计

#include <iostream>using namespace std;int main(){ int n, count = 0; char a[100]; cin >> n; while (n){ cin >> a; for (int i = 0; a[i] != '\0'; i++){ if (a[

2017-04-19 16:59:49 1380

原创 杭电ACM2016:数据交换输出

#include <iostream>using namespace std;int main(){ int n, min,t=0,temp; int a[100]; while (cin >> n && n){ for (int i = 0; i < n; i++) cin >> a[i]; min = a[0]; for

2017-04-19 10:48:15 427

原创 杭电ACM2015:偶数求和

//输出格式出错#include <iostream>using namespace std;int main(){ int n, m, y, x, sum = 0, ave; int a[100]; while (cin >> n >> m){ x = n / m; y = n % m; for (int i = 0;

2017-04-19 10:12:58 609

原创 杭电ACM2014:青年歌手打分

#include <iostream>using namespace std;int main(){ double sum = 0, avr; int n,max=0,min=100; int a[100]; while (cin >> n){ for (int i = 0; i < n; i++){ cin >> a[i]

2017-04-14 16:40:55 512

原创 杭电ACM2013:蟠桃记

#include <iostream>using namespace std;int Fun(int a){ int f, n = a; if (n == 2) f = 4; else f = (Fun(n-1) + 1) * 2; return f;}int main(){ int n,S; while (cin >> n){

2017-04-14 16:17:31 436

原创 用opencv中的warpAffine获取仿射变换图片保存

#include <iostream>#include <vector>#include <time.h>#include <opencv2/opencv.hpp>//#include <opencv2/highgui/highgui.hpp>//#include <opencv2/contrib/contrib.hpp>//#include <opencv2/imgproc/imgpr

2017-04-13 21:37:17 357

原创 随机数

#include <iostream>#include <stdlib.h>#include <time.h>using namespace std;int main(){ int n; cin >> n; srand((unsigned)time(NULL));//以当前时钟设置随机数种子 for (int i = 0; i < n; i++)

2017-04-13 14:17:03 129

原创 杭电ACM2012:素数判定

#include <iostream>#include <cmath>using namespace std;int isPrime(const int a){ int flag = 1; int b = a; for (int i = 2; i < sqrt(b); i++){ if (b%i == 0) flag=0; } retur

2017-04-12 21:04:26 608

原创 杭电ACM2011:多项式求和

#include <iostream>using namespace std;int main(){ int m; int a[1000]; cin >> m; for (int i = 0; i < m; i++) cin >> a[i]; double s = 0, t; for (int i = 0; i < m; i++){

2017-04-11 15:18:36 411

原创 杭电ACM2010:水仙花数

#include <iostream>using namespace std;int main(){ int m, n; int a, b, c,flag=0; int x[1000]; while (cin >> m >> n) { if (m > n){ n = m + n; m = n

2017-04-10 16:13:42 558

原创 杭电ACM2009:求数列的和

#include <iostream>#include <cmath>using namespace std;int main(){ double n, m; while (cin >> n >> m){ double s = n; for (int i = 1; i < m; i++){ //从第二项起递增开方;m-1次

2017-04-10 15:21:17 690

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除