自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 关于字符串 “*****AB**C*D*****” 中前缀、后缀和中间 '*' 的处理

一、删除前缀 '*' 1 #include<iostream> 2 #include<cstdio> 3 4 using namespace std; 5 6 //主函数 7 int main() 8 { 9 char chr[20],*b,*p; //字符串缓冲区;字符串头指针;字符串临时指针 10 ...

2016-04-03 13:43:00 249

转载 #include< > 和 #include” ” 的区别

一、#include< >  #include< >引用的是编译器的类库路径里面的头文件。  假如你编译器定义的自带头文件引用在 C:\Keil\c51\INC\ 下面,则 #include<stdio.h> 引用的就是 C:\Keil\c51\INC\stdio.h 这个头文件,不管你的项目在什么目录里, C:\Keil\c51\INC\s...

2016-04-01 21:55:00 1623

转载 小朋友排队

一、题目分析  表面上看,这是一道排序题,但实际上,这道题目不仅仅要求简单的排序,因为题目要求的是小朋友从低到高排序后,他们的不高兴程度之和的最小值,也就是求逆序对数的题目。  例如:样例输入 (3, 2, 1) 中,有 3 个逆序对—— (3, 2) , (3, 1) , (2, 1) ,使用使小朋友不高兴之和最小的排序方法后,即首先交换身高为 3 和 2 的小朋友...

2015-03-26 23:30:00 279

转载 核桃的数量

一、题目分析  这道题目意思很容易明白,解题方法也很简单,就是求三个整数(三个小组的加班人数)的最小公倍数。二、最小公倍数介绍  最小公倍数(Least Common Multiple,缩写 L.C.M.),如果有一个自然数 a 能被自然数 b 整除,则称 a 为 b 的倍数,b 为 a 的因数,对于两个整数来说,指该两数共有倍数中最小的一个。  计算最小公倍数...

2015-03-22 14:54:00 78

转载 操作格子

一、题目分析  刚刚看完题目的时候,我立马想到的是用数组来存储 n 个格子的权值,但是,这样做的话,没有办法在时间限制的 1s 完成操作,出现运行超时。  这是因为题目的数据规模与约定是:对于 100% 的数据 1 <= n <= 100000,m <= 100000,0 <= 格子权值 <= 10000。详细分析如下:  由题目可知:...

2015-03-17 23:30:00 93

转载 字串统计

1 #include<stdio.h> 2 #include<string.h> 3 4 //定义子串参数结构体 5 struct sub_str 6 { 7 char sstr[61]; //子串 8 int len; //子串长度 9 int times; //子串出现的次数 ...

2015-03-15 18:18:00 125

转载 关联矩阵

1 #include<stdio.h> 2 3 int main() 4 { 5 int i,j,k; 6 int n,m; //n:用于记录图中的节点的数目;m:用于记录图中边的数目 7 int edge[1000][2]; //用于存储输入的图的(a,b)边 8 9 scanf...

2015-03-10 23:28:00 208

转载 寻找数组中最大值

1 #include<stdio.h> 2 3 int main() 4 { 5 int i; 6 int n; //用于记录输入的数组元素的个数 7 int a[100]; //用于存储输入的数组 8 int max,subscript; //max:数组中的最大值;subscript:数组中...

2015-03-08 16:14:00 81

转载 Torry的困惑(基本型)

1 #include<stdio.h> 2 3 int main() 4 { 5 long long i,j; 6 int n; //用于记录输入的要进行乘积的质数的个数 7 long long product=1; //用于记录前n个质数的乘积,并初始化为 1 8 int num=0; //用...

2015-03-08 15:46:00 79

转载 最小乘积(基本型)

1 #include<stdio.h> 2 3 int main() 4 { 5 int i,j,k; 6 int t,n; //t:数据组数;n:每组数据的两行中每行的个数 7 int a[2][8]; //用于存储输入的每组数据中的两行数据 8 int temp; //用于对每行数据排序的过...

2015-03-08 14:30:00 104

转载 删除数组零元素

1 #include<stdio.h> 2 #include<stdlib.h> 3 4 //函数声明 5 int CompactIntegers(int *p,int n); 6 7 int main() 8 { 9 int i;10 int n,n_final; //n:用于记录要输入的...

2015-03-07 22:43:00 201

转载 动态数组使用

1 #include<stdio.h> 2 #include<stdlib.h> 3 4 int main() 5 { 6 int i; 7 int n; //用于记录输入的整数的个数 8 int *p; //用于指向动态数组的存储空间 9 int sum=0,average; ...

2015-03-07 21:04:00 82

转载 大小写转换

1 #include<stdio.h> 2 #include<string.h> 3 4 int main() 5 { 6 int i; 7 char str[21]; //用于存储输入的字符串 8 int str_len; //用于记录输入的字符串的长度 9 10 ...

2015-03-07 21:03:00 154

转载 矩阵乘法

1 #include<stdio.h> 2 3 //宏定义 4 #define max_row 200 //定义矩阵最大的行数 5 #define max_column 200 //定义矩阵最大的列数 6 7 int main() 8 { 9 int i,j,k;10 int m,s,n; //用于...

2015-03-07 16:15:00 114

转载 出现次数最多的整数

1 #include<stdio.h> 2 3 int main() 4 { 5 int i,j; 6 int n; //用于记录要输入的整数的个数 7 int a[20]; //用于存储输入的n个整数 8 int max_num_int; //用于记录出现次数最多的整数 9 in...

2015-03-05 23:03:00 114

转载 Anagrams问题

1 #include<stdio.h> 2 #include<string.h> 3 4 int main() 5 { 6 int i; 7 char word1[81],word2[81]; //分别用于存储输入的两个单词 8 int word1_len,word2_len; //分别用于记...

2015-03-05 20:14:00 87

转载 前缀表达式

1 #include<stdio.h> 2 3 //函数声明 4 int Add(int x,int y); //加 5 int Subtract(int x,int y); //减 6 int Multiply(int x,int y);//乘 7 int Divide(int x,int y); //除 8 9...

2015-03-05 17:13:00 93

转载 2的次幂表示

1 #include<stdio.h> 2 3 void Power(int n); 4 5 int main() 6 { 7 int n; 8 9 while(scanf("%d",&n)!=EOF) //读取正整数未出错 10 {11 Power(n);12 ...

2015-03-03 21:47:00 114

空空如也

空空如也

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

TA关注的人

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