![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
qq_2423338532
这个作者很懒,什么都没留下…
展开
-
矩阵连乘
不打印矩阵版本#include<iostream>#include<stdio.h>using namespace std;int s[10000][10000];int p[100];int RecurMatrixChain(int i,int j);int main(){ int m,n,t,num; cin >> m; ...原创 2019-12-08 17:11:47 · 114 阅读 · 0 评论 -
7-9 整除光棍
这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被一个不以5结尾的奇数整除。比如,111111就可以被13整除。 现在,你的程序要读入一个整数x,这个整数一定是奇数并且不以5结尾。然后,经过计算,输出两个数字:第一个数字s,表示x乘以s是一个光棍,第二个数字n是这个光棍的位数。这样的解当然不是唯一的,题目要求你输出最小的解。...原创 2019-12-08 15:58:37 · 126 阅读 · 0 评论 -
C++文件读写 转载
C++文件读写详解(ofstream,ifstream,fstream)转载 2019-04-06 20:57:38 · 109 阅读 · 0 评论 -
图书信息管理系统整理总结
#include中的iomanip的一些用法C/C++ 中 exit() 函数原创 2019-04-04 21:45:19 · 580 阅读 · 0 评论 -
C语言中%*s中*是什么作用?
取决于在scanf中使用还是在printf中使用。在scanf中使用,则添加了*的部分会被忽略,不会被参数获取。例如:int a,b;char b[10];scanf("%d%*s",&a,b);输入为:12 abc那么12将会读取到变量a中,但是后面的abc将在读取之后抛弃,不赋予任何变量(例如这里的字符数组b)在printf中使用,表示用后面的形参替代的位置,实现动态格式输出。...转载 2019-03-17 20:23:21 · 3336 阅读 · 0 评论 -
明码 18蓝桥
标题:明码汉字的字形存在于字库中,即便在今天,16点阵的字库也仍然使用广泛。16点阵的字库把每个汉字看成是16x16个像素信息。并把这些信息记录在字节中。一个字节可以存储8位信息,用32个字节就可以存一个汉字的字形了。把每个字节转为2进制表示,1表示墨迹,0表示底色。每行2个字节,一共16行,布局是:第1字节,第2字节第3字节,第4字节....第31字节, 第32字节这道题目...转载 2019-03-19 18:35:53 · 75 阅读 · 0 评论 -
C++中的字符串比较——字符数组、字符串(类)、字符指针
C++中的字符串比较——字符数组、字符串(类)、字符指针转载 2019-05-05 14:35:51 · 191 阅读 · 0 评论 -
参数传递
#include<iostream>using namespace std;void f(int &n){ n = 1; return;}int main(){ int n = 0; f(n); cout << n << endl; return 0;}原创 2019-05-15 11:39:07 · 95 阅读 · 0 评论 -
HDU1425 sort -排序练习
给你n个整数,请按从大到小的顺序输出其中前m大的数。Input每组测试数据有两行,第一行有两个数n,m(0<n,m<1000000),第二行包含n个各不相同,且都处于区间[-500000,500000]的整数。Output对每组测试数据按从大到小的顺序输出前m大的数。Sample Input5 33 -35 92 213 -644Sample Output213 92...原创 2019-08-06 23:04:58 · 73 阅读 · 0 评论 -
B - Solving Order HDU - 5702
#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<cmath>#include<complex>#include<string>#include<algorithm>#include...原创 2019-08-20 21:55:51 · 119 阅读 · 0 评论 -
E - EXCEL排序 HDU - 1862
# include <stdio.h># include <string.h># include <algorithm>using namespace std;struct student{ int id; char name[20]; int score;}s[100010];int cmp1(student a,stu...原创 2019-08-20 22:24:05 · 83 阅读 · 0 评论 -
F - As Easy As A+B HDU - 1040
# include <stdio.h># include <string.h># include <algorithm># include <iostream>using namespace std;int a[1010];int T, N;int cmp(int a, int b){ if(a>b) return 0;...原创 2019-08-21 10:35:48 · 85 阅读 · 0 评论 -
strncpy 和 strcmp
strncpy 是 C语言的库函数之一,来自 C语言标准库,定义于 string.h,char *strncpy(char *dest, const char *src, int n),把src所指向的字符串中以src地址开始的前n个字节复制到dest所指的数组中,并返回被复制后的dest。extern int strcmp(const char *s1,const char *s2);C/...原创 2019-03-19 14:35:31 · 151 阅读 · 0 评论 -
危险系数
//一次dfs就可以了,求出s到t的每一条路径,如果s到t间的某个点每次都在其中,那么这个点就是割点//我感觉求桥也可以用map这样实现啊#include<cstdio>#include<iostream>#include<vector>using namespace std;int n,m,way[1005],cnt[1005],s,t,ans,v...原创 2019-02-19 22:01:16 · 159 阅读 · 0 评论 -
引用交换两个数
#include<iostream.h>void swap(float &m, float &n);int main(){ float a, b; cin >> a >> b; //pa = &a; pb = &b; swap(a, b); cout << a << endl <原创 2018-09-25 09:41:24 · 615 阅读 · 0 评论 -
D - Oil Deposits HDU - 1241
D - Oil Deposits HDU - 1241The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and cr...原创 2018-10-19 15:05:26 · 162 阅读 · 0 评论 -
kmp
#include&lt;iostream&gt;#include &lt;string&gt;#include &lt;cstring&gt;#define Maxn 100using namespace std;void GetNext(char* p,int next[]);int KmpSearch(char* s, char* p);char p[Maxn], s[Maxn]...原创 2018-10-29 17:44:50 · 89 阅读 · 0 评论 -
重建树
#include&amp;amp;lt;iostream&amp;amp;gt;#include&amp;amp;lt;cstdio&amp;amp;gt;using namespace std;int t1[1001],t2[1001];void sousuo(int a,int b,int n,int flag){ cout &amp;amp;lt;&amp;amp;lt; &原创 2018-11-04 16:52:49 · 131 阅读 · 0 评论 -
01bag
#include <iostream>#include <cstring>using namespace std; const int N=15; int main(){ int v[N]={0,8,10,6,3,7,2}; int w[N]={0,4,6,2,2,5,1}; int m[N][N]; int n=6,c=12; m...原创 2018-11-10 21:35:52 · 147 阅读 · 0 评论 -
dp学习
https://blog.csdn.net/FX677588/article/details/68951593https://blog.csdn.net/xp731574722/article/details/70766804https://vjudge.net/contest/268186#rank白皮书的递归代码,分析一下重复情况理解第一个链接的思路学习第二个链接的dp做法自己画一...原创 2018-11-08 17:00:46 · 98 阅读 · 0 评论 -
老边给我的学习links
Dijkstra算法:源代码:啊哈算法(https://blog.csdn.net/riba2534/article/details/54563524) 或者 https://www.cnblogs.com/biyeymyhjob/archive/2012/07/31/2615833.html思路可以参考:https://blog.csdn.net/qq_35644...原创 2018-11-15 09:39:57 · 113 阅读 · 0 评论 -
素数筛筛筛筛筛筛筛筛筛筛
https://blog.csdn.net/CPOHUI/article/details/78667490#include&amp;lt;iostream&amp;gt;#include&amp;lt;vector&amp;gt;using namespace std;const int maxt = 1000000;vector&amp;lt;bool&amp;gt;prime;int main(原创 2018-11-19 21:08:09 · 172 阅读 · 0 评论 -
判断回文 Able was I ere I saw elba
#include&amp;lt;iostream&amp;gt;#include&amp;lt;algorithm&amp;gt;#include&amp;lt;cstring&amp;gt;#define maxn 105using namespace std;char a[maxn];int q, p, alen, n;bool f();int main(){ cin &am原创 2018-11-19 21:44:41 · 584 阅读 · 0 评论 -
复数的加减乘除
#include<iostream>using namespace std;typedef struct {double real;double imag;} cpxNum;cpxNum c;void assign(cpxNum &c, double r, double i); //初始化void print(cpxNum c); //打印cpxNum cp...原创 2018-11-19 23:14:32 · 686 阅读 · 0 评论 -
畅通工程续 HDU - 1874
学习视频 https://www.bilibili.com/video/av4224493?from=search&amp;amp;seid=12835389426564300048题目链接 https://vjudge.net/problem/HDU-1874、#include&amp;lt;bits/stdc++.h&amp;gt;#include&amp;lt;iostream&amp;gt;#include&原创 2018-11-17 21:16:49 · 103 阅读 · 0 评论 -
a.length()
#include<iostream>#include<cmath>#include<cstdio>#include<string>using namespace std;int main(){ string a; cin >> a; cout << a.size() << endl原创 2018-12-25 09:05:01 · 3481 阅读 · 0 评论