![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++编程
Easy.miclover
做一个会思考的程序猿
展开
-
求字符串中第k个多的字符
//#include <iostream> //#include<string> #include<bits/stdc++.h> using namespace std; int main() { string str = "acacabcbdbfbdbd"; int count[256] = {0}; int k=3; int index = 0...原创 2018-07-16 23:07:22 · 1322 阅读 · 0 评论 -
数组中第k大的数
#include<iostream> using namespace std; int quickSort(int s[], int l, int r) { if (l< r) { int i = l, j = r, x = s[l]; while (i < j) { while(...原创 2018-08-07 15:38:22 · 168 阅读 · 0 评论 -
数组中出现次数超过一半的数字
class Solution { public: int MoreThanHalfNum_Solution(vector<int> numbers) { int length = numbers.size(); return MoreThanHalfNum(numbers, length); } int MoreTha...原创 2018-09-03 17:05:14 · 88 阅读 · 0 评论 -
C++中 & 和 * 的区别
& :为取地址运算符,&a 的值为a的地址; *: 指针运算符,或指向运算符,也称间接运算符,*p 代表p所指向的变量。原创 2019-01-19 14:57:24 · 1549 阅读 · 0 评论 -
I/O 模板
有时候写代码,经常在学了很久之后,回头发现,对于某一具体程序语言居然会突然想不起来,输入该怎么写了,好尴尬,所以写这篇博文方便自己以后查找。也希望可以帮到其他人。 一、C语言 1、以EOF为结束标志 scanf 返回值为变量的个数,如果没有返回 -1, int a, b; // EOF 是一个预定义的常量 -1 while (scanf("%d %d", &am...原创 2019-10-04 23:13:21 · 305 阅读 · 0 评论