07 2021 档案
摘要:#include <stdio.h> //定义一个参数类型为 函数指针的函数 int calc(int x, int y, int (*pt)(int, int) ); int add(int,int); int sub(int,int); int getSum(int,int); int getG
阅读全文
摘要:#include <stdio.h> //fopen函数的包 #include <stdlib.h> //exit()函数的包 #include <string.h> //typedef为数据类型搞一个别名,规范这个别名通常会用大写 typedef char * STRING; //用define来
阅读全文
摘要:#include <stdio.h> //fopen函数的包 #include <stdlib.h> //exit()函数的包 #include <string.h> //定义一个枚举类型(默认从0开始) enum ctype1 { one = 6, two, three, four, five}
阅读全文
摘要:#include <stdio.h> //fopen函数的包 #include <stdlib.h> //exit()函数的包 #include <string.h> //定义结构 struct Person{ char id; int name [4]; double score; }; //定义
阅读全文
摘要:#include <stdio.h> //fopen函数的包 #include <stdlib.h> //exit()函数的包 #include <string.h> //定义一个带有匿名结构成员的结构 struct Person{ char id; int name [4]; struct {ch
阅读全文
摘要:#include <stdio.h> //fopen函数的包 #include <stdlib.h> //exit()函数的包 #include <string.h> //定义一个结构- 把struct Person当做一种数据类型 struct Person{ char id; int name
阅读全文
摘要:#include <stdio.h> //fopen函数的包 #include <stdlib.h> //exit()函数的包 #include <string.h> //定义一个结构- 把struct Person当做一种数据类型 struct Person{ int id; char name
阅读全文
摘要:#include <stdio.h> //fopen函数的包 #include <stdlib.h> //exit()函数的包 #include <unistd.h> //定义一个结构- 把struct Person当做一种数据类型 struct Person{ char *name; int ag
阅读全文
摘要:#include <stdio.h> //fopen函数的包 #include <stdlib.h> //exit()函数的包 #include <unistd.h> //定义一个结构- 把struct Person当做一种数据类型 struct Person{ char *name; int ag
阅读全文
摘要:#!/bin/bash #定义数组1 arr1=('gao' 1 b c) arr2[0]=10 arr2[1]=9 arr3[3]="gaocun" #读取元素 echo ${arr1[0]} echo ${arr2[1]} #读取元素所有的值 echo ${arr1[*]} echo ${arr
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <unistd.h> //1.静态数组 int i_arr1[3] = {1, 2, 3}; int size = 3; int main() { //创建数组的三种方法 /*1.静态数组 特点:1.用常
阅读全文
摘要:/* --生成随机数的函数(返回一个0~32768的伪随机数)*/ static unsigned long int next = 1; //种子 unsigned int rand0() { /* 生成伪随机数的魔术公式*/ next = next * 1103515245 + 123456; r
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> int value1 = 100; //文件作用域、外部链接、静态存储期 int static value2 = 99; //文件作用域(仅限翻译单元)、内部链接、静态存储期 void isOk(); void isOk1
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> void isOk(); int main() { isOk(); isOk(); isOk(); int index; return 0; } void isOk() { int index ; static int c
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> int main() { const char *pt = "abcdef"; /* 1.abcdef字符串字面量对象 2.字符数组对象(单个元素也是对象) 3.标识符为pt的对象,存储字符串的地址 const 修饰的是字
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> int main() { char * spt = " 1100100.1111end...."; printf("将字符串%s转成数值类型: 2int:%d 2long:%ld 2double:%f\n", spt, a
阅读全文
摘要:#include <stdio.h> #include <string.h> int main(int argc,char * arr[]) { //当前脚本的输入参数的计数 printf("当前脚本输入的个数为:%d\n",argc ); //接收的参数内容为,只能接受字符串,用空白符分割,格式为
阅读全文
摘要:#include <stdio.h> #include <string.h> int main() { char str[] = "mnbvcxzlkjhgfdsapoiuytrewq"; int size = strlen(str); int index = 0; for (int i = siz
阅读全文
摘要:#include <stdio.h> #include <string.h> int * getarr(int * ipt); int main() { int a = 99; char * ch ; int *p = getarr(&a); //gets(ch); printf("%d\n", *
阅读全文
摘要:#!/usr/bin/python # -*- coding: UTF-8 -*- #get_min_char 获取指定字符串中最小的字符 def get_min_char(str): min = str[0]; for ch in str: if( min > ch ): min = ch ret
阅读全文