【程序1】 题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? 程序分析:可填在百位、十位、个位的数字都是1、2、3、4。组成所有的排列后再去 掉不满足条件的排列。 1 #include 2 using namespace std; 3 int main() 4 { ...
分类:
其他好文 时间:
2014-10-06 17:21:50
阅读次数:
184
//树的存储结构//双亲存储结构typedef struct{ int data;//结点的值 int parent;//指向双亲位置的伪指针} PTree[maxsize];//孩子存储结构typedef struct node{ int data;//结点的值 struct node *sons...
分类:
其他好文 时间:
2014-10-06 17:07:30
阅读次数:
190
考察DFS的应用,用栈描述字符串的变化过程。 1 #include 2 #include 3 int len1,len2; 4 char str1[100],str2[100],stk[100],ans[200]; 5 6 void output(int n){ 7 int i; 8 ...
分类:
其他好文 时间:
2014-10-06 17:03:40
阅读次数:
147
网上查了很多,发现查资料不如查源码
以Cv为开头的类,都是不含有具体数据的(仅仅存储指针)
CvMat
typedef struct CvMat
{
int type;
int step;
/* for internal use only */
int* refcount;
int hdr_refcount;
union
{
...
分类:
其他好文 时间:
2014-10-06 16:05:30
阅读次数:
143
先来介绍三个个API函数AddFontResource,SendMessage,RemoveFontResource。AddFontResource这是一个添加字体资源到系统字体表中,原型如下:int AddFontResource( LPCTSTR lpszFilename // point...
辗转相减,新手入门题。两个容量的灌水题,无所谓最优解。 1 #include 2 3 int main(){ 4 int A,B,T,sA,sB; 5 while(scanf("%d %d %d",&A,&B,&T)>=0){ 6 sA=sB=0; 7 ...
分类:
其他好文 时间:
2014-10-06 15:59:10
阅读次数:
210
------Java培训、Android培训、iOS培训、.Net培训、期待与您交流! -------数据类型总结一、基本数据类型1.int(整型)1>long int 长整型,也可以简写成long, 占据8个字节,占位符用%ld2>short int小的整型,也可以简写成short,占据2个字节,...
分类:
其他好文 时间:
2014-10-06 15:20:20
阅读次数:
157
由0-9表示的数字串,现使其中4个数字不可用,用余下的数字进行重编码。写出编码和解码函数。前缀编码,前5个剩下的编码用一个数字编码。最后一个以及不可用的4个数字,用两个数字进行编码。 1 class Coding { 2 public: 3 void init(int unc...
分类:
其他好文 时间:
2014-10-06 14:41:20
阅读次数:
214
1 P1881 闪烁的繁星分治,维护几个结果即可。#include #include using namespace std;const int maxn = 200007;int a[maxn> 1; build(l, m, i> 1; if (p = m-l+1) ...
分类:
其他好文 时间:
2014-10-06 14:28:00
阅读次数:
239
代码: #include?<stdio.h>
#include?<stdlib.h>
int?main(void)?{
int?a,?b;
a?=?10;
//?逗号表达式保证被它分开的表达式按从左到右的次序执行
//?逗号是个顺序点,逗号左边产生的副作用都在程...
分类:
其他好文 时间:
2014-10-06 14:13:20
阅读次数:
166