自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(34)
  • 收藏
  • 关注

原创 C语言二叉树

C语言树

2022-06-20 17:37:46 95

原创 C语言链表

Slist.c#include"SLish.h"void SlistPrint(SListNode* phead){ SListNode* cur = phead; while (cur!=NULL) { printf("%d->", cur->data); cur=cur->next; } printf("NULL");}SListNode *BuySListNode(SListDataType x){ SListNode* newnode =

2021-12-18 10:02:26 1275

原创 C语言顺序表增删查改

list.h#pragma once#include<stdlib.h>#include <stdio.h>#include<assert.h>#include<string.h>#include<errno.h>typedef int SLDataType;#define N 10//struct SeqList//{// SLDataType a[N];// int size;////};typedef str

2021-12-12 17:50:40 596

原创 C语言预处理

//程序 输入输出缓存区 磁盘#include <stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#include<errno.h>int main(){ FILE *f=fopen("tset.c", "w");//文件信息区 if (f==NULL) { printf("%s", strerror(errno)); return 0; .

2021-12-10 13:42:13 91

原创 C语言完整通讯录

test.c#include <stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#include "contact.h"#define _CRT_SECURE_NO_WARNINGS 1void menu();int main(){ int input = 0; struct Contact con; InitContact(&con);

2021-12-08 17:21:20 286

原创 c语言文件操作

//程序 输入输出缓存区 磁盘#include <stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#include<errno.h>int main(){ FILE *f=fopen("tset.c", "w");//文件信息区 if (f==NULL) { printf("%s", strerror(errno)); return 0; }.

2021-12-08 17:19:36 59

原创 C语言添加动态内存的通讯录

#include <stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#include "contact.h"#define _CRT_SECURE_NO_WARNINGS 1void menu();int main(){ int input = 0; struct Contact con; InitContact(&con); do {.

2021-12-08 12:30:03 106

原创 C语言动态内存分配

#include<stdlib.h>struct s{ int n; int arr[0]; //int *arr;};int main(){ //void* p = realloc(NULL, 40);//malloc(40) int i = 0; int* p = (int*)malloc(10 * sizeof(int)); if (NULL==p) { exit(EXIT_FAILURE); } for ( i = 0; i < 10; i+.

2021-12-08 12:02:02 302

原创 C语言通讯录

#include <stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#include "contact.h"#define _CRT_SECURE_NO_WARNINGS 1void menu();int main(){ int input = 0; struct Contact con; InitContact(&con); do {.

2021-12-07 10:29:18 95

原创 C语言struct

#include <stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#include<errno.h>#include<ctype.h>#define _CRT_SECURE_NO_WARNINGS 1void* my_memcopy(void* dest,void* str, size_t num);struct{ char a}a;.

2021-12-06 14:11:57 46

原创 C语言字符函数

#include <stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#include<errno.h>#include<ctype.h>#define _CRT_SECURE_NO_WARNINGS 1void* my_memcopy(void* dest,void* str, size_t num);int main(){ char ar.

2021-12-06 09:16:18 118

原创 c语言字符函数

#include <stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#define _CRT_SECURE_NO_WARNINGS 1void move(char *arr,int x);void move1(char* arr, int x);void reverse(char* left, char* right);char* str_cat(char* dest.

2021-12-04 12:12:16 87

原创 c语言库函数qsort

#include <stdio.h>#include<stdlib.h>#include<assert.h>#include<string.h>#define _CRT_SECURE_NO_WARNINGS 1void bubble_sort(int arr[], int sz);void Swap(char* b1, char* b2, int width);/*int add(int x, int y);void print(char*s.

2021-12-01 10:35:05 513

原创 c语言指针类型

//指针数组 int* aa[10]; //数组指针 int* (*paaa)[10] = &aa; //函数指针 int (*paaaa)(int, int) = add; //函数指针的数组 int (* pfarr[4])(int, int); //指向函数指针数组的地址 int(*(*ppfarr)[4])(int, int) = &pfarr; //pfarr是一个数组 函数指针的数组 //ppfarr是一个数组指针,指向4个元素每个元素的类型是一个函数指针.

2021-11-30 22:05:41 189

原创 c语言函数指针

#include <stdio.h>#include<stdlib.h>#include<assert.h>#define _CRT_SECURE_NO_WARNINGS 1/*int add(int x, int y);void print(char*str);int main() { //int (*p)(int, int) = add; //printf("%d", (*p)(2, 3)); void (*p)(char*) = print;.

2021-11-30 21:52:46 281

原创 C语言指针进阶 函数指针的数组 指针数组 数组指针

#include <stdio.h>#include<stdlib.h>#include<assert.h>/*int add(int x, int y);void print(char*str);int main() { //int (*p)(int, int) = add; //printf("%d", (*p)(2, 3)); void (*p)(char*) = print; (*p)('dasdas'); return 0;}int .

2021-11-30 20:51:14 691

转载 代码练习网站

1,Coding Games网址:www.codingame.com2、CodeCombat(极客战记)CodeCombat 网址:cn.codecombat.com极客战记(中国版 CodeCombat)网址:codecombat.163.com3、Screeps网址:screeps.com4、Checkio网址:checkio.org5、Vim Adventures网址:vim-adventures.com6、Cyber Dojo网址:www.cyber-dojo.org/源代

2021-11-26 19:27:37 1420

原创 C语言指针进阶

void p1(int (*p)[2],int x,int y) { int i = 0; for ( i = 0; i < x; i++) { int j = 0; for ( j = 0; j < y; j++) { printf("%d", *(*(p + i) + j)); printf("%d", (*(p + i))[j]); printf("%d", p[i][j]); } printf("\n"); }}int main.

2021-11-08 18:04:05 715

原创 C语言调试代码

#include <stdio.h>#include<stdlib.h>#include<assert.h>char* my_cp(char* dest,const char* ret);int my_len(const char* str);int main(){ int i = 0; int sum = 0; int ret = 1; int n = 0; scanf_s("%d", &n); for (i = 1; i <= .

2021-11-07 20:46:15 799

原创 strcut结构体

#include <stdio.h>struct Stu{ char name[20]; short age; char tlel[12];}s1,s2,s3;typedef struct Stu{ char name[20]; short age; char tlel[12];}stu;void prints(stu ss) { printf("%s", ss.age);}void print2(stu* ss) {...

2021-11-06 17:24:36 265 1

原创 c语言指针

C语言指针int *p=&a;指针是个变量,存放内存单元的地址(编号)指针类型进行解引用操作的时候,能够访问空间的大小int* p; *p4个字节char *p, *p 1个字节double *p; *p 8个字节指针类型决定了,指针一步能走几个int *p; p+1->4char* p; p+1->1double *p; p+1->8;int arrp[10]={0};int *p=arr;int i=0;for(int i=0;i<10;i+.

2021-09-25 15:17:34 51

原创 C语言操作符

C语言算术符号算术右移右边丢弃,左补符号位#include<stdio.h>int main(){ int a = 16; a >> 1; return 0;}#include<stdio.h>//按2进制位异或//相同为0,相异为1int main(){ int a = 16; int b = 5; a=a^b; b=a^b; a=a^b printf("%d\n", a...

2021-09-24 10:41:23 58

原创 C语言实现扫雷

1.test.cpp#include<stdio.h>#define _CRT_SECURE_NO_WARNINGS 1#include "game.h"void meun() { printf("***************\n"); printf("****1.play*****\n"); printf("****0.exit*****\n"); printf("***************\n");}void game() { char mine[

2021-09-22 09:02:48 46

原创 通过C语言实现关机

#include<stdio.h>#include<stdlib.h>#include<string.h>int main() { char input[20] = { 0 }; system("shutdown -s -t 60");again: printf("请输入我是SB\n"); scanf("%s", input); if (strcmp(input,"我是SB")==0) { system("shutdown -a"); } .

2021-08-27 19:00:14 99

原创 C语言异或简单用法

代码如下:#include<stdio.h>int main() { //异或的用法 3^3=0 0^3=3 //找出数组里面单独的数字 int arr[] = { 1,2,3,4,5,6,1,2,3,4,5,6,8 }; int i = 0; int uni_n = 0; int sz = sizeof(arr) / sizeof(arr[0]); for ( i = 0; i < sz; i++) { uni_n = uni_n ^ arr[i];

2021-08-27 18:44:11 574

原创 C语言的交换两个数字操作

1.#include<stdio.h>int main() { int a = 5; int b = 6; int tmp; tmp = a; a = b; b = tmp; printf("%d %d", a, b); return 0;}2.不用第三个变量进行换值#include<stdio.h>int main() { int a = 5; int b = 6; a = a + b; b = a - b; a = a -

2021-08-27 18:33:05 86

原创 C语言实现三子棋(五子棋可以改赢得函数即可)

三子棋游戏源文件:test.cpp(主要用来调用函数) game.cpp(用来实现函数)头文件:事先声明函数避免警告,共享库test.cpp代码如下​#include<stdio.h>#define _CRT_SECURE_NO_WARNINGS 1#include "game.h"#include <time.h>void menu() { printf("********************************\n"); printf...

2021-08-27 17:37:37 106

原创 C语言数组

数组的创建type_t arr_name [cons_n]//常量表达式strlen 是求字符串长度sizeof 计算变量数组类型大小单位是字节char arr[]="sadsa"int i =0;for(i=0;i<(int)strlen(arr);i++){printf("%c",arr[i]);}二维数组int arr [3][4]={{1,2,3,4},{,34,54,5}}//列不能省略int i=0;for (i=0;i<3;i++){ int...

2021-08-27 14:48:57 41

原创 c语言函数和递归

c语言api网站查询https://en.cppreference.com/w/https://devdocs.io/c/http://www.cplusplus.com//* strcpy example */#include <stdio.h>#include <string.h>int main (){ char str1[]="Sample string"; char str2[40]; char str3[40]; strcpy (str2...

2021-08-26 19:37:26 48

原创 C语言循环for do()while 和while

顺序结构选择结构循环结构int x=1if(18<x<20)->if(0<20)所以是错的else是和最近的一个if所匹配switch(){case 1:case 2:case 3:break...case n:breakdefault}break是终止switch避免贯穿case只能是整形常量表达式getchar()end of file (EOF)int ret;int ch=0;char password[10]={0};prin.

2021-08-20 22:27:13 177

原创 c语言笔记(关键字,指针内存,struct)

1.如果局部变量有static修饰那么局部变量的生命周期延长并且不销毁2.static让静态的全局变量只能在自己所在的源文件使用\0停止符extern 声明外部全局变量,声明外部函数(把外部连接属性改变成内部链接属性)#define MAX(x,y) (x>y?x:y) 通过宏来表达函数指针如何找到内存?如何指定有多大的空间?&a给出a的地址 p是指针变量 p的类型叫int*int* p =&a*p叫做解应用符int a=10;int*p =&a*p=

2021-08-19 15:59:45 64

原创 Phazed: Q1 (group types)

Write a function calledphazed_group_typethat takes the following single argument:groupA group of cards in the form of a list, each element of which is a 2-character string with the value (drawn from'234567890JQKA') followed by the suit (drawn from'...

2021-05-18 10:07:22 361

原创 python 飞机大战

第一个自己做的python小游戏import pygameimport randomimport mathpygame.init()screen = pygame.display.set_mode((800,600))pygame.display.set_caption("fight game2021")icon=pygame.image.load('D:/resource/icon.jpg')bgImg=pygame.image.load('D:/resource/bg.jpg')..

2021-05-10 13:58:08 172

转载 项目 grok 3

Write a function potential_contacts(person_a, person_b) that identifies all of the potential contacts between two people, given data on their movement over multiple days.The function takes the following arguments,person_a person_b,which are each list

2021-04-21 16:20:42 518

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除