//选择法对输入的10个字符按ASCII码大小进行排序 #include <stdio.h> #define N 10 int main(){ char a[N]; char t; int i,j; printf("请输入10个字符:\n"); for(i=0;i<N;i++){ scanf("%c ...
分类:
编程语言 时间:
2020-08-21 16:37:06
阅读次数:
95
存储类定义 C 程序中变量/函数的范围(可见性)和生命周期。这些说明符放置在它们所修饰的类型之前。下面列出 C 程序中可用的存储类: auto register static extern auto 存储类 auto 存储类是所有局部变量默认的存储类。 { int mount; auto int m ...
分类:
其他好文 时间:
2020-08-20 19:24:57
阅读次数:
110
intmain(){//交换两个int的变量,不创建额外变量inta=3;intb=5;printf("%d%d\n",a,b);a=a^b;//a=a+bb=a^b;//b=a-ba=a^b;//a=a-bprintf("%d%d\n",a,b);return0;}
分类:
其他好文 时间:
2020-08-18 15:47:12
阅读次数:
126
int main()
{
int mun = 0;
int i = 0;
int count = 0;
scanf("%d", &mun);
for ( i = 0; i < 32; i++)
{
if (1 == ((mun >> i) & 1))
count++;
}
printf("%d ", count);
return 0;
}
分类:
其他好文 时间:
2020-08-18 15:46:51
阅读次数:
120
#include<iostream> #include<stdio.h> #include<string.h> #include<math.h> using namespace std; int fact(int n,int p) //十进制转为任意进制 (n是十进制数,p是要转化进制选择) { i ...
分类:
其他好文 时间:
2020-08-18 15:41:07
阅读次数:
103
树链剖分基本操作: 1. 修改第i条边的权值。 2. 对树上一条路径的权值取反(正变负,负变正)。 3. 查询树上一条路径的权值的最大值。 因为要取反,所以要同时维护最大值和最小值。 1 #include<cstdio> 2 #include<cstring> 3 #include<algorith ...
分类:
其他好文 时间:
2020-08-18 13:36:03
阅读次数:
62
畅通工程再续 HDU - 1875 思路: 1.将一条边加入最小生成树时有额外条件,注意一下即可。 2.如果所有点均可连通,那么应该在同一个集合里,也就是有同一个根节点;如果出现了不同的根节点说明没有全部连通。 然后就是套模板。 const int maxn = 100 + 10; const in ...
分类:
其他好文 时间:
2020-08-17 17:24:17
阅读次数:
57
题目:CGfbs 题目描述:菜鸡面对着printf发愁,他不知道printf除了输出还有什么作用。 题目分析:照着题目描述来看,应该是格式化字符串的漏洞。老规矩,照着步骤走: 1.checksec和file 2.ida 由上面的我们用32位的idapro打开。 可以看到结构也十分简单,pwnme等于 ...
分类:
其他好文 时间:
2020-08-17 17:16:27
阅读次数:
61
金题大战Vol.0 A、凉宫春日的叹息 题目描述 给定一个数组,将其所有子区间的和从小到大排序,求第 \(k\) 小的是多少。 输入格式 第一行两个数$n$,$ k$,表示数组的长度和$k$; 第二行有 \(n\) 个数,第$i$个是$a[i]$,表示给定的数组。 输出格式 仅一个数,表示答案。 样 ...
分类:
其他好文 时间:
2020-08-15 22:34:12
阅读次数:
75
#include<iostream> using namespace std; struct node { int v,height; node*lchild; node*rchild; int data; }; int x; node* newNode(int v) { node*Node =ne ...
分类:
其他好文 时间:
2020-08-13 12:14:51
阅读次数:
95