上一页 1 2 3 4 5 6 ··· 24 下一页
摘要: #include#include#include#includestruct link{ int data; struct link *next;};void delMiddle(link *head){ if(head == NULL) return; else if(head->next == NULL) { delete head; return; } else { link *low = head; link *fast = hea... 阅读全文
posted @ 2013-10-30 21:42 夜雨阑珊 阅读(324) 评论(0) 推荐(0) 编辑
摘要: #includeint max(int a,int b){ return (a>b?a:b);}int findBiggestSum(int *B,int k){ int m=0,n;//m存储:到B[i[结束的最大子数组和 //n存储B[i]之前的最大数组和,可能包括B[i],也可能不包括 int i; n=B[0]; for(i=1;i<k;i++) { m=max(B[i],m+B[i]); n=max(n,m); } return n;}int main(){ int A[10]={2,4,-9,4,8,7,-3,-7,6,3}; int sum; sum=findBigg 阅读全文
posted @ 2013-10-30 21:18 夜雨阑珊 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 跳频技术是目前国内国际上比较成熟的一种技术。主要用于军用通信中,它可以有效的避开干扰,发挥通信效能。跳频技术与直序扩频技术完全不同,是另外一种意义上的扩频。跳频的载频受一个伪随机码的控制,在其工作带宽范围内,其频率合成器按伪随机码( PN码)的随机规律不断改变频率。在接收端,接收机的频率合成器受伪随机码的控制,并保持与发射端的变化规律一致。跳频是载波频率在一定范围内不断跳变意义上的扩频,而不是对被传送信息进行扩谱,不会跳频得到直序扩频的处理增益。跳频相当于瞬时的窄带通信系统,基本等同于常规通信系统,由于无抗多径能力,同时发射效率低,同样发射功率的跳频系统在有效传输距离内小于直扩系统。跳频的优点 阅读全文
posted @ 2013-10-29 13:33 夜雨阑珊 阅读(6226) 评论(0) 推荐(0) 编辑
摘要: 将以空格为分隔符分隔的字符串逆序打印,但单词不逆序。例如“Hello world Welcome to China”的打印结果为“China to Welcome world Hello”。#include #include /* Print string str partially, from start to end-1. */void print_word(const char * str, int start, int end){int i; for (i = start; i = 0; --i){if (' ' == str[i]){/* Print the word 阅读全文
posted @ 2013-10-25 13:53 夜雨阑珊 阅读(682) 评论(0) 推荐(0) 编辑
摘要: #include union u{ int i; char c; }ui; int main(void) { ui.i=512; ui.c='a'; printf("%i",ui.i); printf("%c",ui.c); // your code goes here return 0;}结构体变量,覆盖,从低地址开始存00000000 00000000 00000010 00000000=51200000000 00000000 0000000097=97覆盖后00000000 00000000 00000010 97取i... 阅读全文
posted @ 2013-10-25 11:56 夜雨阑珊 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 链表操作#include #include #include #include using namespace std;typedef struct student{ int data; struct student *next;}node;/* 链表的创建*/node *creat(){ node *head,*p,*s; int x; int cycle=1; head=(node*)malloc(sizeof(node)); p=head; while(cycle) { cout>x; if(x!=0) ... 阅读全文
posted @ 2013-10-10 14:56 夜雨阑珊 阅读(239) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;void func(int *p, int n, int k);void main(){ int a[]={1,2,3,4,5}; int i; func(a,5,2); for(i=0;i=0)//右移 { while(k) { temp=p[n-1]; for(i=n-1;i>0;i--) p[i]=p[i-1]; p[0]=temp; k--; ... 阅读全文
posted @ 2013-10-10 14:42 夜雨阑珊 阅读(742) 评论(0) 推荐(0) 编辑
摘要: 1.找出一个数组中满足2^N的元素#include using namespace std;int find(int a[],int len);void main(){ int a[]={1,2,3,5,7,8,16}; int len=sizeof(a)/sizeof(int); coutusing namespace std;void Joseph(int n, int m, int s);int main(){ Joseph(9,3,1); return 0;}void Joseph(int n, int m, int s){ int i,j,w; ... 阅读全文
posted @ 2013-09-30 15:09 夜雨阑珊 阅读(369) 评论(0) 推荐(0) 编辑
摘要: Problem A. Bad HorseConfused? Read the quick-start guide.Small input 112 points Solve A-small-1You may try multiple times, with penalties for wrong submissions.Small input 221 points You must solve small input 1 first.You may try multiple times, with penalties for wrong submissions.ProblemAs t... 阅读全文
posted @ 2013-09-27 17:45 夜雨阑珊 阅读(1053) 评论(0) 推荐(0) 编辑
摘要: 引自:http://www.189works.com/article-42111-1.html先来看几个概念:重载(overload),重写(override,也称覆盖), 重定义(redefine,也称隐藏)(PS:第三个我不确定在英文中是否应该称为redefine,如有问题,留言告知,谢谢)一、重载(overload)指函数名相同,但是它的参数表列个数或顺序,类型不同。但是不能靠返回类型来判断。(1)相同的范围(在同一个作用域中) ;(2)函数名字相同;(3)参数不同;(4)virtual 关键字可有可无。(5)返回值可以不同;问题哪个可以是double add(int a,int b)的 阅读全文
posted @ 2013-09-27 17:18 夜雨阑珊 阅读(479) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 24 下一页