自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 递归问题求解

【实验内容1】 用递归算法生成n个整数的全排列。 【算法讲解】 设R={r1,r2,…,rn}是要进行排列的n个元素,Ri=R-{ri}。 集合X中元素的全排列记为perm(X)。 (ri)perm(X)表示在全排列perm(X)的每一个排列前加上前缀得到的排列。 R的全排列可归纳定义如下: 当n=1时,perm®=®,其中r是集合R中唯一的元素; 当n>1时,perm®由(r1)perm(R1),(r2)perm(R2),…,(rn)perm(Rn)构成。 实现思想:将整组数中的所有的数分别与第一个

2021-03-29 22:16:37 565

原创 插入排序

编程实现插入排序算法,并分析算法的时间复杂度。 #include<stdio.h> int main(){ int n; int i,j,k; int a[100]; int b[100]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } b[0]=a[0]; k=0; for(i=1;i<n;i++){ j=k; while((b[j]>a[i])&amp

2021-03-23 21:48:40 122

原创 内螺旋方阵

1、编程实现如下所示内螺旋方阵 如给定任意值n,比如输入,4和3分别输出如下: 16 15 14 13 9 8 7 5 4 3 12 2 1 6 6 1 2 11 3 4 5 7 8 9 10 #include<stdio.h> int main(){ int n ; int i,j,k,

2021-03-23 21:47:28 828

原创 凯撒密码

给定一个单词,请使用凯撒密码将这个单词加密。   凯撒密码是一种替换加密的技术,单词中的所有字母都在字母表上向后偏移3位后被替换成密文。即a变为d,b变为e,…,w变为z,x变为a,y变为b,z变为c。 #include <stdio.h> #include <string.h> int main() { char a[20]; int n,i; gets(a); ...

2019-12-21 19:01:57 7879 1

原创 洁净数

小明非常不喜欢数字 2,包括那些数位上包含数字 2 的数。如果一个数的数位不包含数字 2,小明将它称为洁净数。   请问在整数 1 至 n 中,洁净数有多少个? #include <stdio.h> #include <stdlib.h> int Count1(int n); int Count2(int n); int Count3(int n); int Count4(...

2019-12-21 19:00:32 1062

原创 物流管理系统

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h> #define N 500 typedef struct materal { long id;// 编号 char name[20];// 品名 int num;// 数量...

2019-12-14 19:40:57 1201

原创 究极简易版打人游戏

#include <stdio.h> #include <time.h> #include <stdlib.h> #include<windows.h> typedef struct Character { char name[10]; int hp; }Character; int main() { int i,k; Character peopl...

2019-12-14 19:38:44 129

原创 背包选择

#include <stdio.h> typedef struct Package { char name[10]; int heavy; int value; float costeffective; }Package; int main() { int i,j,n,k; Package temp; Package a[10]; printf(“请输入物品种类\n”); scanf(...

2019-12-14 18:39:29 90

原创 埃氏筛

#include <stdio.h> #include <math.h> int main(){ int count=0; int i,j; bool a[100001]; for(i=0;i<=100000;i++)a[i]=true; a[0]=a[1]=false; for(i=2;i<=100...

2019-12-14 17:28:50 88

空空如也

空空如也

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

TA关注的人

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