自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 java jdk1.6实现zip解压

第一部分,入参两个,一个是为压缩包或文件,另一个是我自己的入参,可删除。zip的解压中,调用了多个方法,只有一个是解压有关的,我放在下面。上面这个方法里,有个文件名的乱码处理,方法是下面这个。暂时只有zip的解压,有机会再找rar的。然后是zip版本的解压。......

2022-08-18 14:26:45 1087

原创 正序输出

#include <iostream> using namespace std; void Reverse( int n){ if(n/10==0) cout<<n; else{ Reverse(n/10); cout<<n%10; } } main(){ Reverse(12345); }

2019-10-26 16:44:20 242

原创 数字三角形最大数字和

#include <iostream> #include <algorithm> using namespace std; const int MAXN = 1005; int A[MAXN][MAXN],F[MAXN][MAXN],n; int main(){ cin>>N; for (int i=;i<=N;i++) for(int j=1;j...

2019-10-25 22:28:37 203

原创 背包问题(贪心算法)

#include <iostream> using namespace std; #define NUM 50 void Knapsack(int n,float M,float v[],float w[],float x[]) { int i; for(i = 1; i <= n; i++) x[i] = 0; float c = M; ...

2019-10-25 22:05:07 383

原创 数字三角形顺推法

#include <iostream> #include <algorithm> using namespace std; const int MAXN = 1005; int A[MAXN][MAXN],F[MAXN][MAXN],N; int main() { cin>>N; for(int i=1;i<=N;i++)...

2019-10-25 20:54:02 185

原创 昆虫繁殖

#include <iostream> #include <vector> #include <iterator> #include <algorithm> #include <list> #include <set> using namespace std; int main(){ long a[101]={0},b[1...

2019-10-25 20:29:34 308

原创 循环赛日程表

#include <iostream> using namespace std; #define MAX 100 int a[MAX][MAX]; void Copy(int tox, int toy, int fromx, int fromy, int r){ for(int i=0;i<r;i++) for(int j=0;j<r;j++) a[tox+i]...

2019-10-25 20:20:44 146

原创 用平方和求递归

#include <iostream> #include<algorithm> #include<vector> #include<iterator> #include<list> using namespace std; int main() { int n; int sum=0; cin>>n; for(...

2019-10-25 13:30:57 236

原创 众数和重数

#include<iostream> #include<algorithm> using namespace std; int n1=0; int n2=0; int count(int a[],int first,int last){ int n = a[(first+last)/2]; int count = 0; for(int i = fi...

2019-10-25 13:01:36 213

原创 硬币问题(贪心算法)

#include<iostream> using namespace std; int main(){ int v[4]={1,5,10,25}; int C[100]; int A; for(int i=0;i<4;i++) cin>>C[i]; ...

2019-10-25 12:57:04 713

原创 蜜蜂路线

#include <iostream> #include <algorithm> #define SIZE 15001 using namespace std; int f[SIZE]; int main(){ int n,m,i; cin>>m>>n; f[m]=1; f[m+1]=1; for(i=m+2;i<=n;i++) f[i]=f[...

2019-10-25 12:41:15 246

原创 整数划分问题

#include<iostream> using namespace std; int zshf(int n,int m){ if(n<1) return 0; else if(n==1||m==1) return 1; else if(n<m) return zshf(n,n); else if(n==m) ...

2019-10-08 21:40:06 131

原创 list的定义与操作

#include<iostream> #include<list> #include<iterator> #include<algorithm> using namespace std; void display(list<int> &v2); int main() { list<int> link; ...

2019-10-08 21:31:29 1437

原创 vector的定义与操作

#include<iostream> #include<vector> #include<iterator> #include<algorithm> using namespace std; void display(vector<int> &v2); int main() { /**vector<int&g...

2019-10-08 21:15:07 221

原创 计算众数和重数

#include<iostream> #include<algorithm> using namespace std; int n1=0; int n2=0; int count(int a[],int first,int last){ int n = a[(first+last)/2]; int count = 0; for(int i = ...

2019-10-08 21:01:11 260

原创 递归算法实现第n个斐波那契数列

#include <iostream> using namespace std; /** 递归算法实现第n个斐波那契数列 */ int fibonacci(int n){ if(n<=1) return 1; else{ return fibonacci(n-1)+fibonacci(n-2); } } int main() { cout<&...

2019-10-08 20:47:08 173

原创 递归-进制a转换成进制

#include <iostream> using namespace std; /** 递归-进制a转换成进制b */ void change(int a,int b){ if(a!=0){ change(a/b,b); cout<<a%b; } } int main() { int a,b; cout<&l...

2019-10-08 20:44:58 112

原创 猴子吃桃问题

#include <iostream> using namespace std; int func(int day){ if(day==10) return 1; else return (func(day+1)+1)*2; } int main(){ cout<<"第一天有"<<fun...

2019-10-08 20:38:18 91

原创 汉诺塔移动次数--递推算法

#include<iostream> using namespace std; void move(char from ,char to) { cout<<"Move"<<from<<"to"<<to<<endl; } void hanoi(int n, char first, char second, char...

2019-10-08 20:36:09 761

空空如也

空空如也

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

TA关注的人

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