上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
摘要: #include <math.h> #include <iostream> #include <algorithm> #include <fstream> #include <iomanip> #include <string> #include <vector> #include <queue> 阅读全文
posted @ 2024-10-18 17:53 某朝 阅读(10) 评论(0) 推荐(0)
摘要: Description 给出一棵二叉树的中序遍历和每个节点的父节点,求这棵二叉树的先序和后 序遍历。 Input 输入第一行为一个正整数 n 表示二叉树的节点数目, 节点编号从 1 到 n,其中 1 为根节点。 第 2 行有 n 个数字, 第 i 个数字表示 i 的父亲节点。( 1 的父亲节点为 0 阅读全文
posted @ 2024-10-18 17:48 某朝 阅读(48) 评论(0) 推荐(0)
摘要: 建树 数组模拟链表(静态链表) 程序框架 1.题意及建树 2.建树及同构判别 #include <iostream> #include <cstring> // for memset using namespace std; const int N = 10; struct TreeNode { c 阅读全文
posted @ 2024-10-17 17:21 某朝 阅读(15) 评论(0) 推荐(0)
摘要: 方法1: #include <stdio.h> int main() { char str[80]; scanf("%[^\n]",str); //读到'\n'结束读取 printf("%s",str); return 0; } %[^\n]读到'\n'结束读取 %[^:]读到:结束读取 方法2: 阅读全文
posted @ 2024-10-15 23:26 某朝 阅读(126) 评论(0) 推荐(0)
摘要: 格式说明符 输出4位而不是保留4位 使用 %.4g 进行格式化,能够确保输出的有效数字为四位,并去掉不必要的后缀零 阅读全文
posted @ 2024-10-15 17:52 某朝 阅读(18) 评论(0) 推荐(0)
摘要: csdn #include <stdio.h> #include <limits.h> #include <float.h> int main() { printf("%zd %d %.15g %.15g\n", sizeof(double), DBL_DIG, DBL_MIN, DBL_MAX); 阅读全文
posted @ 2024-10-13 13:29 某朝 阅读(76) 评论(0) 推荐(0)
摘要: 数据范围 Description 输出双精度数占用的字节数、有效数字、表示范围;整数占用的字节数、表示范围。双精度数的最小值、最大值必须用指数形式输出,有效位按照双精度数的最大有效位输出。 Input 无 Output 第1行 双精度数占用的字节数、有效数字、最小值、最大值 第2行 整数占用的字节数 阅读全文
posted @ 2024-10-13 13:22 某朝 阅读(32) 评论(0) 推荐(0)
摘要: 常量的非法与合法 常量 浮点常量 题1 下述只有( )不是C语言合法的常量。 A) 0x2af4bD5UL B) +123L C) 0xg34 D) -987 E) 1001101 F) 1001101B G) 0123456789L H) 0.123 I) .123 J) 123. K) 123. 阅读全文
posted @ 2024-10-13 11:17 某朝 阅读(108) 评论(0) 推荐(0)
摘要: 浮点数 有一双精度值d=1.23456789,从键盘输入输出值要求的宽度和小数位数(0<宽度和小叔位数<=10),要求按该输出格式要求输出d。 如:输入:8(输出值要求的宽度) 4(小数位数),要求输出: 1.2346(数值前面有2个空格)。 #include <stdio.h> int main( 阅读全文
posted @ 2024-10-11 23:39 某朝 阅读(27) 评论(0) 推荐(0)
摘要: ![](https://img2024.cnblogs.com/blog/3448102/202410/3448102-20241010233248756-631392391.png) 阅读全文
posted @ 2024-10-10 23:33 某朝 阅读(17) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页