- 博客(13)
- 收藏
- 关注
原创 JS笔记
继承 一圣杯模式: Father.prototype.lastName=“laodeng” function Father(){ } function Son(){ } function inherit(Target,Origin){ function F(){} F.prototype = Origin.prototype; Ta...
2019-03-30 19:55:11
213
转载 c++数组去重
https://blog.youkuaiyun.com/qq_41139830/article/details/80631988
2019-03-22 21:06:06
12392
原创 第七题 牌型种类
题目 第七题 https://wenku.baidu.com/view/fe752820240c844768eaee06.html #include<bits/stdc++.h> using namespace std; int ans=0; int num[13]; void dfs(int step) { if(step13) { int sum=0; for(int i=0;i&...
2019-03-18 21:49:28
218
原创 蓝桥杯:交换瓶子
有N个瓶子,编号 1 ~ N,放在架子上。 比如有5个瓶子: 2 1 3 5 4 要求每次拿起2个瓶子,交换它们的位置。 经过若干次后,使得瓶子的序号为: 1 2 3 4 5 对于这么简单的情况,显然,至少需要交换2次就可以复位。 如果瓶子更多呢?你可以通过编程来解决。 输入格式为两行: 第一行: 一个正整数N(N<10000), 表示瓶子的数目 第二行:N个正整数,用空格分开,表示瓶子目前...
2019-03-17 14:00:33
225
原创 插入排序
#include <bits/stdc++.h> using namespace std; int a[]={9,5,8,2,7,3,4,1}; void insertSort(int a[],int len) { for(int i=1;i<len;i++) { int j=0; while(a[j]<a[i]&&j<i) j++; if(j!=i)...
2018-11-24 11:37:23
139
原创 归并排序
#include <bits/stdc++.h> using namespace std; int a[]={9,5,8,2,7,3,4,1}; int b[8]; void merge(int a[],int s,int m,int e,int tmp[]) { int p1=s,p2=m+1; int p=0; while(p1<=m&&p2<=e) {...
2018-11-24 11:00:51
117
原创 快速排序
#include <bits/stdc++.h> using namespace std; int a[]={9,5,8,2,7,3,4,1}; void swap(int &h,int &l) { int c=h; h=l; l=c; } void quickSort(int a[],int p,int q) { int i=p,j=q; int k=a[p]; if...
2018-11-24 10:43:38
107
原创 1031 查验身份证 (15 分)
#include #include #include #include #include <bits/stdc++.h> using namespace std; int k=0; int main() { int n; string str[100],str1[100]; char arr[11]={‘1’,‘0’,‘X’,‘9’,‘8’,‘7’,‘6’,‘5’,‘4’,...
2018-11-04 22:46:17
333
转载 c++ 输入
1、cin 1、cin.get() 2、cin.getline() 3、getline() 4、gets() 5、getchar() 1、cin>> 用法1:最基本,也是最常用的用法,输入一个数字: #include using namespace std; main () { int a,b; cin>>a>>b; cout<<a+b<&l...
2018-10-21 12:06:26
257
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅