爱嘉牛LA

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2014年2月20日

摘要: 以下程序是在一本C++书出现的,觉得挺好的,就保留下来。#include#include#includeusing namespace std;int main(){ maps; //用来存储字母出现次数的映射 char c; //存储输入字符 do{ cin>>c;//输入下一个字符 if(isalpha(c)){//判断是否为字母 c=tolower(c);//将字母转为为小写 s[c]++;//将该字母的出现频率加1 } }while(c!='.'); //输... 阅读全文
posted @ 2014-02-20 22:07 爱嘉牛LA 阅读(593) 评论(0) 推荐(0) 编辑

摘要: 第一步:下载MATLAB 7.0,下载自己百度下就好。 三个ios文件 第二步:把每个IOS文件直接右键解压就好。第三步:打开第一个解压文件夹。双击.exe文件第四步:next之后把序列号黏贴上去,这里给出个序列号。14-58204-39252-07634-11570-16849-09455-22809-05445-13616-29058-08276-06885 -12215-41987-21894-60423-57622-18647-58411-24238-20443-59027-07209-27706-28292 -14609-15393-48293-13036-12293-43713-5 阅读全文
posted @ 2014-02-20 14:14 爱嘉牛LA 阅读(224) 评论(0) 推荐(0) 编辑

2013年12月21日

摘要: #includeusing namespace std;int BaseTrans(int data,int B){ int s; if(data==0) return 0; //结束递归算法 s=data%B; BaseTrans(data/B,B); cout<<s<<" ";}int main(){ int data=15, B=2;//指定要转换成的数 BaseTrans(data,B); return 0;}View Code 阅读全文
posted @ 2013-12-21 23:10 爱嘉牛LA 阅读(321) 评论(0) 推荐(0) 编辑

2013年10月29日

该文被密码保护。 阅读全文
posted @ 2013-10-29 08:54 爱嘉牛LA 阅读(1) 评论(0) 推荐(0) 编辑

2013年5月23日

摘要: A=a1+b1*X+c1*X^2+d1*X^3+...B=a2+b2*X+c2*X^2+d2*X^3+...C=(a1+a2)+(b1+b2)*X+(c1+c2)*X^2+(d1+d2)*X^3+... 1 typedef int datatype; 2 3 typedef struct node... 阅读全文
posted @ 2013-05-23 04:18 爱嘉牛LA 阅读(537) 评论(0) 推荐(0) 编辑

摘要: 改用尾指针表示单循环链表,寻找头指针和尾指针很方便,快速。如果用头指针记录循环链表,寻找时间为Q(n)如果用尾指针记录循环链表,寻找头指针rear->next->next,查找时间Q(1) 1 typedef int datetype; 2 typedef struct node{ 3 datetype data; 4 struct node *next; 5 } linklist; 6 linklist *head,*p; 7 8 linklist *CONNECT(linklist *ra,linklist *rb){ 9 linklist *p;10 p... 阅读全文
posted @ 2013-05-23 02:43 爱嘉牛LA 阅读(397) 评论(0) 推荐(0) 编辑

2013年5月4日

摘要: View Code #include "iostream"#include "cstring"using namespace std;char *output(int n,int m){ char ch[]="0123456789ABCDEF"; char *tmp=new char[100]; char *result=NULL; memset(tmp,0,100); int i=0,j; while(n) { tmp[i]=ch[n%m]; n/=m; i++;... 阅读全文
posted @ 2013-05-04 20:45 爱嘉牛LA 阅读(173) 评论(0) 推荐(0) 编辑

2013年2月18日

摘要: 以下是基于二维数组本身就是连续的思想编写的View Code 1 #include<iostream> 2 using namespace std; 3 void printfA(int *p,int row,int col){//二维数组的第一个小元素地址,a[0][0]的地址,行,列 4 int i; 5 for(i=0;i<row*col;i++,p++){ 6 if(i%col==0) 7 cout<<endl; 8 cout<<" "<<*p; 9 }10 cout<<endl;11 }12... 阅读全文
posted @ 2013-02-18 23:15 爱嘉牛LA 阅读(508) 评论(0) 推荐(0) 编辑

2012年12月23日

该文被密码保护。 阅读全文
posted @ 2012-12-23 21:30 爱嘉牛LA 阅读(4) 评论(0) 推荐(0) 编辑

2012年12月19日

该文被密码保护。 阅读全文
posted @ 2012-12-19 16:17 爱嘉牛LA 阅读(4) 评论(0) 推荐(0) 编辑