Description给定n(N#include#include#includeusing namespace std;int n;struct node{ int a[1100],l; node() { memset(a,0,sizeof(a)); l...
分类:
其他好文 时间:
2015-01-06 23:06:49
阅读次数:
224
#include
using namespace std;
int main()
{
int N = 0;
while(cin>>N)
{
int *students = new int [N + 1];//students[0]保留不用
memset(students, 1, sizeof(int) * (N +1...
分类:
其他好文 时间:
2015-01-05 16:41:34
阅读次数:
115
struct node{
int Count;
node *next[26];
node(){ //初始化数据
memset(next,NULL,sizeof(next));
Count=0;
}
};
node *p,*root=new node();
void Insert(char *s)//插入新单词
{
int i...
分类:
其他好文 时间:
2015-01-05 14:53:58
阅读次数:
237
背景:无。#include
#include
int main(void){
int t,str[10];
scanf("%d",&t);
while(t--){
int n;
memset(str,0,sizeof(str));
scanf("%d",&n);
for(int i=1;i<=n;i++){
if(i/1000) {str[i/1000]...
分类:
其他好文 时间:
2015-01-05 13:03:06
阅读次数:
892
相信很多人都知道这个函数,也都用过,但可能很多人跟我过去一样,认为它是赋初值函数,而不知它赋初值是八位八位进行的,知道了这句话那你之后的就都懂了。
首先它是在头文件string.h中,这说明了什么呢,他操作的是字符类型,而字符类型有几位呢,那就是八位,所以它就是按八位来赋初值的。之所以我们平时可以用
int array[100];
memset(array,0,sizrof(array));...
分类:
其他好文 时间:
2015-01-05 00:36:41
阅读次数:
144
输入一个字符串,输出出现次数最少,或者说出现频率最小的字符。
#include
#include
using namespace std;
int main()
{
string s;
cin>>s;
int fre[26];
memset(fre,0,sizeof(fre));
for (int i=0;i<s.size();i++)
fre[s[i]-'a']+...
分类:
其他好文 时间:
2015-01-04 10:04:53
阅读次数:
151
#include
#include
#include
using namespace std;
int main()
{
int chArray[26] ;
memset(chArray, 0, 26*sizeof(int));
int N =0;
string s;
cin>> N;
while (N--)
{
memset(chArray, 0, 26*sizeof(i...
分类:
其他好文 时间:
2015-01-03 21:06:15
阅读次数:
241
主要是在初始化UI值的时候遇到问题,一直报错但确实没有用到ui_width,ui_height...,仔细检查例子工程发现,少了一个AEFX_CLR_STRUCT宏AEFX_CLR_STRUCT其实是将结构初始化。上面就是没初始化结构,导致的看了一下官方论坛,似乎更快的初始化方式用memset,不过...
分类:
其他好文 时间:
2015-01-03 15:46:46
阅读次数:
226
以下的知识点比较零散,经常在编程中用到的,做个笔记:1、memset 函数原型: void * memset(void * Dst, int Val, size_t Size); 作用: 将已经开辟内存空间Dst的首Size个字节的值设为值val 如: memset(header->w...
分类:
编程语言 时间:
2015-01-01 18:28:42
阅读次数:
221
结构体使用sort算法时,重载operator#include #include #include #include using namespace std;typedef struct SidInterface {SidInterface() {memset(this, 0, sizeof(Sid...
分类:
其他好文 时间:
2014-12-25 20:20:11
阅读次数:
159