03 2020 档案
摘要:#include<iostream> using namespace std; int main() { int arr[10][10]; //存放10个int指针数组,每个数组中存放10个int元素,则用二维数组来表示 int(*p)[10] = arr; //定义一个指针数组指向该内存地址, i
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <string> #include <windows.h> #include <stdint.h> #include <tlhelp32.h> #include <iostream> #include <vector>
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> struct Node { int id; Node* next; }; //初始化头节点 Node* init_m_head() { Node* temp
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #define MAX 26 void test(char* p) { int num = 0; //定义一个变量记录中间的值 for (int i = 0;
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <easyx.h> //定义一个双链表节点 struct Node { int x; //数据 int y; int z; Node* next; //下个数据 Node* last; //上个数据 };
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> //定义一个双链表节点 struct Node { int date; //数据 Node* next; //下个数据 Node* last; //上个数据 }; //定义list存放node指针 struct List
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> typedef struct Array { int* data; //存储的数据 int len; //顺序表的个数 int listsize; //顺序表
阅读全文
摘要:#include <iostream> /* 输入一行字符串仅由小写字母所构成。 输出为一行,按 aa, bb, cc, …, zz 在字符串中的出现次数按从多到少, 将 aa, bb, cc, …, zz 排序,不同字母间以一个空格隔开,忽略行末空格。 阐述: 1.计算出现次数时是可重叠的,即在字
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> typedef struct Link { int data; Link* last; //前驱指针 Link* next; //后继指针 }link; struct DataStore { link* head; //头
阅读全文
摘要:#include<stdio.h> #include <iostream> using namespace std; //选择排序的理解:每次循环n-1次,每一次找出一个最大或者最小的值并记录,当每次循环结束时,将找到的值放在末尾或者首部,然后继续循环 void swap(int *a, int *
阅读全文
摘要:#include<stdio.h> #include <iostream> #include <fstream> using namespace std; int main() { ifstream infile; //以读模式打开文件 infile.open("C:/123.txt"); //打开
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <conio.h> #include <string.h> void fun(char *w, int m) { char s, *p1,
阅读全文
摘要://题目:若有程序段int a[5] = { 1, 2, 3, 4, 5 }; int *p = (int *)(&a + 1); printf("%d,%d", *(a + 1), *(p - 1)); 则输出的结果是(),()#define _CRT_SECURE_NO_WARNINGS #in
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> //编程题:往文件里写入字母表的26个字母。 //要求:如果字母对应编码值 是奇数则写入大写 是偶数则写入小写字母。 int main() { FILE* fp = fopen("C:/123.tx
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> struct Student { char name[50];// 姓名 int id; //id int age; //年龄 char ch; //编组 double fenshu;//分数 };
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include <math.h> #include <easyx.h> #include <graphics.h> typedef struct T_circle { int x; //x轴坐标 i
阅读全文
摘要:#include <stdio.h> #include <easyx.h> #include <graphics.h> void huayuan() { BeginBatchDraw(); cleardevice();//把之前的画板清楚 // setlinestyle(PS_SOLID,5); /
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <iostream> struct Node { int data; Node* next; }; Node* init_Node_m_head() //动态创建头节点 { Node* temp = (Node*)ma
阅读全文
摘要:#include <iostream> #include <stdio.h> #include <stdlib.h> #include <easyx.h> #include <graphics.h> #include <time.h> #include <tchar.h> int map[4];//
阅读全文
摘要:#include <stdio.h> #include <string.h> char* Find_str(char* p) { for (int i = 0; i < strlen(p); i++) { for (int j = 0; j < strlen(p); j++) { if (p[j]
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> struct Array //定义一个数据存储结构 { int* data;//内存地址 int length;//顺数表长度 int listsize;//顺序表大小 }; typ
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> long long reslut(int n) //返回long long型整数 { long long jieguo = 1; //定义结果初始值为1,否则
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> int main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); int relust_a = 0; int re
阅读全文
摘要://例题:求Sn=a+aa+aaa+…+aa…aaa(有n个a)之值,其中a是一个数字,为2。 例如,n=5时=2+22+222+2222+22222,n由键盘输入。//题目来源:https://www.dotcpp.com/oj/problem1013.html#include <stdio.h>
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> //输入一个任意位数的int整数,并判断该整数的位数,并输出每一位数(每个数字中间用空格隔开,最后一位不需要空格),然后在倒序输入每个数字 //例子如下 /* 输入:12345 5 1 2 3 4
阅读全文
摘要:#include <stdio.h> //题目:现有公鸡5元一只,母鸡3元一只,小鸡1元3只(小鸡不能单买 最少3只起卖),此时顾客有100元,请问有多少种购买方案。 int main() { int i, j, k; //定义公鸡i 母鸡j 小鸡k 公鸡5元一只 母鸡3元一只 小鸡1元3只 int
阅读全文
摘要:#include <stdio.h> #include <windows.h> using namespace std; template<typename T> //定义一个函数模板 T Add(T a, T b) { return a + b; } template<typename Y> Y
阅读全文
摘要:#include <iostream> #include <windows.h> using namespace std; struct ConText1 { int id; string name; }; //转换longlong无符号整数类型 unsigned long long transla
阅读全文

浙公网安备 33010602011771号