#在#include<stdio.h>中存在sscanf函数能将字符串中分成多个部分,分别转化为不同类型进行返回; ##sscanf(char *s,type,destination) //s为字符数组名,type为转化的种类(与scanf中的格式相同),destination为返回的目标 inst ...
分类:
编程语言 时间:
2020-08-24 16:39:46
阅读次数:
59
1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e5+5; 4 bool isprime[maxn]; 5 int prime[maxn]; 6 int mu[maxn]; 7 int cnt=0; 8 void ...
分类:
其他好文 时间:
2020-08-24 16:36:48
阅读次数:
60
点击查看代码块 #include <bits/stdc++.h> #define ed end() #define bg begin() #define mkp make_pair #define pb push_back #define vv(T) v(v(T)) #define v(T) vec ...
分类:
其他好文 时间:
2020-08-21 16:38:12
阅读次数:
84
//选择法对输入的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
题意:有两个数组a和b,可以随意调换数组中的元素的顺序,令 c[ i ] = a[ i ] ^ b[ i ],使c的字典序最小。 思路:每个数按二进制从高位到低位看作一个字符串,对a和b数组分别建一棵01字典树,并记录每个结点出现的次数。然后同时遍历这两棵字典树,优先走当前位相同的(0和0,1和1) ...
分类:
其他好文 时间:
2020-08-20 18:46:24
阅读次数:
57
2020.08.05 1、多线程 2、IPC、共享内存 3、bind 4、合并n个有序链表 (力扣原题 使用最小堆会快一些) #include <queue> using namespace std; struct ListNode { int val; ListNode* next; ListNo ...
分类:
其他好文 时间:
2020-08-20 18:20:10
阅读次数:
118
约瑟夫问题: #include <stdio.h> #include <stdlib.h> typedef struct node{ int data; struct node * next; }node; //创建一个有n个结点的循环链表 node * initLink(int n){ node ...
分类:
其他好文 时间:
2020-08-20 18:19:30
阅读次数:
49
1.ansibleplaybook介绍playbook是ansible用于配置,部署,和管理被控节点的剧本。通过playbook的详细描述,执行其中的一系列tasks,可以让远端主机达到预期的状态。playbook就像Ansible控制器给被控节点列出的的一系列to-do-list,而被控节点必须要完成。也可以这么理解,playbook字面意思,即剧本,现实中由演员按照剧本表演,在Ansible中
分类:
其他好文 时间:
2020-08-19 20:09:01
阅读次数:
137
struct关键字是用来定义一个新的类型,这个新类型里面可以包含各种其他类型,称为结构体。 #include <stdio.h> typedef struct { int a; int b; }Stu; Stu getStu(int x, int y) { Stu result; result.a ...
分类:
编程语言 时间:
2020-08-19 19:42:50
阅读次数:
65