随笔分类 - c随笔
摘要:http://www.520xiazai.com/soft/CLion-2020.html
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdbool.h> 3 #include <stdlib.h> 4 5 #define MAXSIZE 10000 6 typedef struct{ 7 char data[MAXSIZE]; 8 int top; 9 10 }S
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 typedef int DataType; 4 struct seqStack 5 {//有3个数据成员 6 int MAXNUM;//用于记录顺序栈中能存放的最大元素个数的 整型 MAXNUM 7 int t
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> typedef int DataType; struct node{ DataType data; struct node *next; }; typedef struct node* PNode; PNode creat
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 #define maxn 100000 5 6 typedef struct { 7 int data; 8 struct node*pri,*next; 9 }node
阅读全文
摘要:#include <stdio.h> #include <string.h> void traToPlu(char ch[]) { int len = strlen(ch), i; char es[] = "es", s[] = "s", *p; if ('y' == ch[len - 1]) {
阅读全文
摘要:#include <stdio.h> int move(int n,int from, int to,int through); int count=0; int main() { move(3,'A','C','B'); return 0; } int move(int n,int from, i
阅读全文
摘要:#include <stdio.h> #include <math.h> #define N 4 int GetMax( int a[]); int GetMin( int a[]); int check(int n); int idigit(int n,int a[]); void is_kabu
阅读全文
摘要:/* * 任务描述:给定一个长字符串和一个短字符串,找出短串在长串中出现的次数, * 并输出每次长串中出现短串的起始位置。(可用字符串相关函数简化编程工作) */ #include<stdio.h> #include <string.h> #define MAX 500 int main() { c
阅读全文
摘要:#include <stdio.h> int main() { int oneYuan,towYuan, fiveYuan,count=0; int sum_money; scanf("%d",&sum_money); int mostOne = sum_money - 7,mostTow = (s
阅读全文
摘要:于是,借助百度,搜了下杨辉三角的性质,发现有一条就是 第n行的第1个数为1,第二个数为1×(n-1),第三个数为1×(n-1)×(n-2)/2,第四个数为1×(n-1)×(n-2)/2×(n-3)/3…依此类推 #include int main(void) { int n,sum; printf(
阅读全文
摘要:#include <stdio.h> main() { int i,x,y,z; z=1; printf("请输入x、y:"); scanf("%d%d",&x,&y); for(i=0;i<y;i++) { z=z*x%1000;//这里采用取余的方法求一个数任意次方后的后三位 } if(z>10
阅读全文
摘要:分析:一般类似的题目都会蕴含某种规律或简便方法的,阶乘末尾一个零表示一个进位,则相当于乘以10而10 是由2*5所得,在1~100当中,可以产生10的有:0 2 4 5 6 8 结尾的数字,显然2是足够的,因为4、6、8当中都含有因子2,所以都可看当是2,那么关键在于5的数量了那么该问题的实质是要求
阅读全文
摘要:运算规则 1、&与运算:对应两个二进位均为1时,结果位才为1,否则为0。(有假为假==0) 2、|或运算:对应的两个二进位有一个为1时,结果位就为1,否则为0。(有真为真==1) 3、^ 异或运算:对应的二进位不同时为1,否则为0。(不同为真==1,相同为假==0) 4、~ 取反运算:对整数的各二进
阅读全文