![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C
神一般的路过
python
展开
-
你知道异或运算吗?
什么是异或运算?异或,英文为exclusive OR,缩写成xor异或(xor)是一个数学运算符。它应用于逻辑运算。异或的数学符号为“⊕”,计算机符号为“xor”。其运算法则为:a⊕b = (¬a ∧ b) ∨ (a ∧¬b)如果a、b两个值不相同,则异或结果为1。如果a、b两个值相同,异或结果为0。z = x ⊕ yz = x xor y以上两个式子是等价的– 引用自百度百科...原创 2020-03-20 18:43:41 · 1562 阅读 · 0 评论 -
蛇形填数
#include#include#define N 20int a[N][N];int main(){int n,x,y,tot=0;scanf("%d",&n);memset(a,0,sizeof(a));tot=a[x=0][y=0]=1;while(tot{while(y+1while(x+1while(y-1>=0&&!a[x][y原创 2016-04-29 21:25:50 · 223 阅读 · 0 评论 -
动态链表解约瑟夫环
#include#include#includetypedef struct node{int data;struct node *next;}Node ,*LinkList;LinkList CreatList(LinkList L,int *num)//创建动态链表{LinkList p , q;L = (LinkList原创 2016-05-06 10:55:33 · 332 阅读 · 0 评论 -
动态单链表的就地逆置
//单链表逆置 #include#include typedef struct node{int data;struct node *next; }Node , *LinkList ; LinkList CreatList(LinkList L,int *num)//创建链表并统计长度,输入0结束; {LinkList p,q;原创 2016-05-06 12:29:51 · 371 阅读 · 0 评论 -
CSAPP中有意思的代码集锦-001
一、 内存引用Bug#include <stdio.h>typedef struct{ int a[2]; double d;} struct_t;double fun(int i){ volatile struct_t s; s.d = 3.14; s.a[i] = 1073741824; printf("%lf\n",...原创 2019-06-21 21:55:43 · 190 阅读 · 0 评论