![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
八块腹肌的小胖
中厂程序猿,有任何需要辅导的功能性代码可随时联系,t-cmath-wulong_stu
展开
-
C++中Sort()函数的用法
Sort函数是快速排序算法头文件:#include <algorithm>1)sort函数默认是从小到大排序的 sort(array,array+n);//两参数表示待排序了的首地址和尾地址2)写一个cmp函数,按照特定的意图进行排序 bool cmp( const int &a,const int &b){ return a<b; ...原创 2018-03-06 23:00:14 · 343 阅读 · 0 评论 -
给定一个字符串S和一个字符x,编写递归算法实现下列功能: (1)检查x是否在s中; (2)计算x在s 中出现的次数; (3)删除s中所有x.
给定一个字符串S和一个字符x,编写递归算法实现下列功能:(1)检查x是否在s中;(2)计算x在s 中出现的次数;(3)删除s中所有x. #include<iostream>using namespace std;//string S="qabcdefghijklmnopqrstuvwxyzxwzluzwswswsmde";char s[1000];int Ti...原创 2018-09-04 11:23:56 · 4822 阅读 · 0 评论 -
单链表
/*有一个带头结点的单链表head,其中可能出值域重复的结点,设计一个算法删除值域重复的结点, 要求在主函数中调用设计的算法,给出结果*/#include<cstdio>#include<algorithm>#include<stack>#include<iostream>#include<malloc.h>using...转载 2018-09-04 11:54:09 · 801 阅读 · 0 评论