自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(41)
  • 收藏
  • 关注

原创 Python+Selenium 开发环境搭建

第一步:下载安装python1. 下载Python安装包,下载地址:python官网 https://www.python.org/,选择自己系统对应的安装包即可,建议安装3.5.3以上版本2.安装完成后,配置环境变量中的path。比如 ;D:\Python (举例,具体应该是python.exe文件的路径)配置环境变量:计算机->属性->高级设置->环境变量-...

2019-11-09 20:21:05 241

原创 栈(三)

#include #include using namespace std;bool Is_Legal(stack&s, const char* &pushstr, const char* &popstr){ if (strlen(pushstr) != strlen(popstr)) { return false; } while (*pushstr != '\0') {

2016-09-22 19:28:16 387

原创 栈(二)

//两个栈实现一个队列/*#include #include using namespace std;templateclass Queue{public: void Push(const T& x) { _PushStack.push(x); } void Pop() { if (_PopStack.empty()) { while (!_PushSt

2016-09-22 19:27:24 256

原创 栈(一)

//实现一个栈,要求实现入栈,出栈,返回最小值的操作,时间复杂度为O(1)#include #include using namespace std;templateclass MinStack{public: void Push(const T& x) { DataStack.push(x); if (MinDataStack.empty()) { MinDa

2016-09-22 19:26:35 256

原创

#pragma once#include #include using namespace std;template class Stack{public: Stack() :_array(NULL) , _capacity(0) , _size(0) {} ~Stack() { if (_array) { delete[] _array; }

2016-09-22 19:25:47 292

原创 队列

#pragma once#include #include using namespace std;templatestruct QueueNode{ T _data; QueueNode* _next; QueueNode(const T&x) :_data(x) , _next(NULL) {}};templateclass Queue{public:

2016-09-22 19:25:10 280

原创 链表-题

#pragma once#include #include typedef int DataType;typedef struct SListNode{ DataType data; struct SListNode* next;}SListNode;void PushBack(SListNode* & pHead, DataType x);void PopBack(SLis

2016-09-22 19:24:11 224

原创 DList

#includeusing namespace std;typedef int DataType;class LinkNode{public: LinkNode(const DataType &x) :_data(x) , _prev(NULL) , _next(NULL) {} friend class DList;private: DataType _data;

2016-09-22 19:23:21 2289

原创 SCList

#pragma once#include using namespace std;typedef int DataType;struct SlistNode{ SlistNode(const DataType& x) :_data(x) , _next(NULL) {} DataType _data; SlistNode* _next;};class Slist{

2016-09-22 19:22:28 367

原创 SeqList

#pragma once#include #include using namespace std;typedef int DataType;class SeqList{public: SeqList() :_array(NULL) , _size(0) , _capacity(0) {} SeqList(DataType* array, size_t size)

2016-09-22 19:21:38 729

原创 c50

//50.使用c语言编写函数:unsigned int reverse_bit(unsigned int value);//这个函数的返回值是value的二进制位模式从左到右翻转后的值/*方法一:通过位运算取出25的每一位二进制数,取出第一个数乘以2^31,第二个数乘以2^30,依次取出并计算出总和#include #include #include typedef unsigned

2016-09-22 19:20:03 516

原创 【c语言】c语言常见编程题总结(五)

/*39.使用c语言编写程序,当输入小写字母a,输出大写字母Z,当输入小写字母b,输出大写字母Y,以此类推。当输入小写字母z,输出大写字母A。#include int main(){ char turn_form(char ch); char ch=0; char ret=0; printf("请输入一个字母:"); scanf("%c",&ch); ret=turn_form(

2016-09-21 20:51:22 575

原创 【c语言】c语言常见编程题总结(四)

/*39.使用c语言编写程序,当输入小写字母a,输出大写字母Z,当输入小写字母b,输出大写字母Y,以此类推。当输入小写字母z,输出大写字母A。#include int main(){ char turn_form(char ch); char ch=0; char ret=0; printf("请输入一个字母:"); scanf("%c",&ch); ret=turn_form(

2016-09-21 20:50:09 523

原创 【c语言】c语言常见编程题总结(三)

/*30.求一个数的二进制序列中1的个数。#include int main(){ int a; int count=0; scanf("%d",&a); while(a>0) { if(a%2==1) count++; a=a/2; } printf("count=%d\n",count); return 0;}// #include // in

2016-09-21 20:49:05 645

原创 【c语言】c语言常见编程题总结(二)

/*20.判断一个字符串是否为回文字符串#include int main(){ char s[100]; int i,j=0; printf("请输入字符串:"); gets(s); i=strlen(s)-1; for(;j<=i;i--,j++) { if(s[i]!=s[j]) break; } if(j<=i) { printf("no\n");

2016-09-21 20:47:46 427

原创 【c语言】c语言常见编程题总结(一)

/*10.交换两个整数的值(传址)传值调用不能改变两个变量的值,而传址能;因为,传值调用仅仅是在函数内,调换参数的值,而地址所指向的值,改变的不仅是函数内,函数外也改变。#include void swap(int *x,int *y){ int temp; temp =*x; *x=*y; *y=temp;}int main(){ int x=1; int y=6;

2016-09-21 20:46:12 996

原创 【数据结构】c++实现HashTable(开链法)

#include #include using namespace std;template struct HashTableNode{ K _key; V _value; HashTableNode* _next; HashTableNode(const K&key, const V&value) :_key(key) , _value(value) , _ne

2016-05-11 00:36:21 3246

原创 【c语言】从标准输入读取c源代码,并验证所有花括号都成对出现

#include #include int main(){ int ch; int braces; braces = 0; while( (ch = getchar()) != EOF ) { if(ch == '{') braces += 1; if(ch == '}') if(braces == 0) printf("extr

2016-04-13 21:46:38 863

原创 【c语言】13个人围成一圈,从第1个人开始顺序报号1,2,3.凡报到3者退出圈子。找出最后留在圈子中的人原来的序号。用链表处理

#include #define N 13struct person{ int number; int nextp;}link[N+1];int main(){ int i,count,h; for(i=1;i<=N;i++) { if(i==N) link[i].nextp=1; else link[i].nextp=i+1; link[i].n

2016-04-13 21:45:49 18971 4

原创 【c语言】编写一个函数new,对n个字符开辟连续的存储空间,此函数应返回一个指针(地址),指向字符串开始的空间

#include #define NEWSIZE 1000char newbuf[NEWSIZE]char *newp=newbuf;char *new(int n){ if(newp+n<=newbuf+NEWSIZE) { newp+=n; return(newp-n); } else return(NULL);}void free(char *p){

2016-04-13 21:44:54 6983

原创 【c语言】一个字符串,包含n个字符。将此字符串中从第m个字符开始的全部字符复制成为另一个字符串。

#include #include int main(){ void copystr(char *,char *,int); int m; char str1[20],str2[20]; printf("input string:"); gets(str1); printf("which character that begin to copy?"); scanf("%d",&

2016-04-13 21:43:20 14288

原创 【c语言】有n个整数,使前面各数顺序向后移m个位置,最后m个数变成最前面m个数

#include int main(){ void move(int [20],int,int); int number[20],n,m,i; printf("how many numbers?"); scanf("%d",&n); printf("input %d numbers:\n",n); for(i=0;i<n;i++) scanf("%d",&number[i]);

2016-04-13 21:42:27 39102 7

原创 【c语言】用递归法将一个整数n转换成字符串

#include int main(){ void convert(int n); int number; printf("input an integer:"); scanf("%d",&number); printf("output:"); if(number<0) { putchar('-'); putchar(' '); number=-number; }

2016-04-13 21:41:39 10197 2

原创 【c语言】用冒泡法对10个字符由小到大排序

#include #include #define N 10char str[N];int main(){ void sort(char []); int i,flag; for(flag=1;flag==1;) { printf("input string:\n"); scanf("%s",&str); if(strlen(str)>N) printf("st

2016-04-13 21:40:50 13534

原创 【c语言】用选择法对10个整数排序

#include int main(){ int i,j,min,temp,a[11]; printf("enter data:\n"); for(i=1;i<=10;i++) { scanf("%d",&a[i]); } printf("\n"); printf("The Orignal numbers:\n"); for(i=1;i<=10;i++) printf(

2016-04-13 21:39:57 44005 1

原创 【c语言】输入一个4位数字,要求输出这4个数字字符,但每两个数字间空一个空格。如:1990->1 9 9 0

#include #include int main(){ void insert(char[]); char str[80]; printf("input digits:"); scanf("%s",str); insert(str); return 0;}void insert(char str[]){ int i; for(i=strlen(str);i>0;i

2016-04-13 21:38:44 10313 1

原创 【c语言】用辗转相除法求最大公约数和最小公倍数

#include #include int main(){ int hcf(int,int); int lcd(int,int,int); int u,v,h,l; scanf("%d,%d",&u,&v); h=hcf(u,v); printf("HCF=%d\n",h); l=lcd(u,v,h); printf("LCD=%d\n",l); return 0;}

2016-04-13 21:37:23 2090

原创 【c语言】将字符数组s2中的全部字符复制到字符数组s1中,不要用strcpy函数,'\0'也复制过去,'\0'后面的字符不复制

#include #include int main(){ char s1[80],s2[80]; int i; printf("input s2:"); scanf("%s",s2); for(i=0;i<=strlen(s2);i++) s1[i]=s2[i]; printf("s1:%s\n",s1); return 0;}

2016-04-13 21:36:09 9927

原创 【c语言】将两个字符串s1和s2比较不要用strcmp

#include int main(){ int i,ret; char s1[100],s2[100]; printf("input string1:"); gets(s1); printf("input string2:"); gets(s2); i=0; while((s1[i]==s2[i])&&(s1[i]!='\0')) i++; if(s1[i]=='\0'

2016-04-13 21:34:59 2892

原创 【c语言】将两个字符串连接起来,不要用strcat函数

#include int main(){ char s1[80],s2[40]; int i=0,j=0; printf("input string1:"); scanf("%s",s1); printf("input string2:"); scanf("%s",s2); while(s1[i]!='\0') i++; while(s2[j]!='\0') s1[i+

2016-04-13 21:33:32 12384

原创 【c语言】输出平行四边形图案

#include int main(){ char a[5]={'*','*','*','*','*'}; int i,j,k; char space=' '; for(i=0;i<5;i++) { printf("\n"); for(j=1;j<=i;j++) printf("%c",space); for(k=0;k<5;k++) printf("%c",

2016-04-13 21:31:21 23334 2

原创 【c语言】输出菱形图案

#include int main(){ int i,j,k; for(i=0;i<=3;i++) { for(j=0;j<=2-i;j++) printf(" "); for(k=0;k<=2*i;k++) printf("*"); printf("\n"); } for(i=0;i<=2;i++) { for(j=0;j<=i;j++) pri

2016-04-13 21:29:42 1712

原创 【c语言】数组简单折半查找

#include #define N 15int main(){ int a[N],i,number,top,bott,mid,loca,flag=1,sign; char c; printf("enter data:\n"); scanf("%d",&a[0]); i=1; while(i<N) { scanf("%d",&a[i]); if(a[i]>=a[i-1]

2016-04-13 21:27:24 885

原创 【c语言】求一个字符串的长度

#include int my_strlen( char *string ){ int length = 0; while( *string++ != '\0') { length += 1; } return length;}int main(){ int ret = my_strlen ("hello world"); printf("%d

2016-04-13 21:23:28 760

原创 【c语言】将二进制整数转换为字符

#include void binary_to_ascii(int value){ int quotient; quotient = value/10; if(quotient != 0) binary_to_ascii( quotient ); putchar( value%10+ '0');}int main(){ binary_to_ascii(4267

2016-04-13 21:21:52 3402

原创 【c语言】用迭代计算斐波那契数

#include int fibonacci(int n){ int result; int previous_result; int next_older_result; result = previous_result = 1; while(n > 2) { n -= 1; next_older_result = previous_result; previ

2016-04-13 21:19:59 607

原创 【c++】用c++实现Date类

#include#includeusing namespace std;class Date{public: Date(int year = 1900, int month = 1, int day = 1) :_year(year),_month(month),_day(day) { assert(year >= 1900); assert(month > 0

2015-12-02 22:55:40 452

原创 【c语言】通讯录

实现一个通讯录;通讯录可以用来存储1000个人的信息,每个人的信息包括:姓名,性别,年龄,电话,住址提供方法:1.添加联系人信息                  2.删除指定联系人信息                  3.查找指定联系人信息                  4.修改指定联系人信息                  5.显示所有联系人信息

2015-03-18 13:00:52 460

原创 【c语言】递归 实现n^k,求非负整数各位数字之和,逆置字符串

1.编写一个函数实现n^k,使用递归实现#include int main(){ int fun(int n,int k); int n; int k; int sum; printf("input n,k:"); scanf("%d,%d",&n,&k); sum=fun(n,k); printf("%d^%d=%d\n",n,k,sum); return 0;}i

2015-03-13 22:07:22 756

原创 【c语言】判断闰年,计算1-1/2+1/3-1/4+1/5-...+1/99-1/100的值

1.判断1000~2000之间的闰年。#includeint main(){int year;for (year=1000;year<=2000;year++){ if(year%4==0) { if(year%100==0) { if(year%400==0) printf("%d\n",year); }

2014-12-26 22:32:36 661 2

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除