会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
cxc1357
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
47
48
49
50
51
52
53
54
55
···
59
下一页
2019年5月6日
[刷题] PTA 查验身份证
摘要: 题目: 7-63 查验身份证 (15 分) 一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下: 首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下
阅读全文
posted @ 2019-05-06 00:32 cxc1357
阅读(2177)
评论(0)
推荐(0)
2019年5月5日
[刷题] PTA 7-62 切分表达式 写个tokenizer吧
摘要: 我的程序: 1 #include<stdio.h> 2 #include<string.h> 3 #define N 50 4 char token[]= {'+','-','*','/','(',')'}; 5 6 int istoken(char c) { 7 int i; 8 for(i=0;
阅读全文
posted @ 2019-05-05 21:56 cxc1357
阅读(457)
评论(0)
推荐(0)
[刷题] 自守数
摘要: 要求:如果某数平方的末尾等于这个数,那么就称这个数为自守数思路:x为待求数,n为x的十进制位数,将x平方后对10^n求模,所得数等于x,则x为自守数 matlab程序: 1 %普通方法 2 tic; 3 index = 0; 4 data = zeros(1,100); 5 for i = 5:10
阅读全文
posted @ 2019-05-05 11:45 cxc1357
阅读(164)
评论(0)
推荐(0)
2019年5月4日
[刷题] PTA 04-树4 是否同一棵二叉搜索树
摘要: 程序: 1 #include <stdio.h> 2 #include <stdlib.h> 3 typedef struct TreeNode *Tree; 4 struct TreeNode{ 5 int v; 6 Tree Left,Right; 7 int flag; 8 }; 9 Tree
阅读全文
posted @ 2019-05-04 22:13 cxc1357
阅读(313)
评论(0)
推荐(0)
[刷题] PTA 03-树2 List Leaves
摘要: 程序: 1 #include <stdio.h> 2 #include <queue> 3 #define MaxTree 20 4 #define Null -1 5 using namespace std; 6 7 struct TreeNode { 8 int Left; 9 int Righ
阅读全文
posted @ 2019-05-04 18:24 cxc1357
阅读(229)
评论(0)
推荐(0)
[刷题] PTA 03-树1 树的同构
摘要: 程序: 1 #include <stdio.h> 2 #define MaxTree 10 3 #define ElementType char 4 #define Tree int 5 #define Null -1 6 7 struct TreeNode { 8 ElementType Elem
阅读全文
posted @ 2019-05-04 15:46 cxc1357
阅读(251)
评论(0)
推荐(0)
[刷题] PTA 02-线性结构1 两个有序链表序列的合并
摘要: 程序: 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 typedef int ElementType; 5 typedef struct Node *PtrToNode; 6 struct Node { 7 ElementType Data; 8 Pt
阅读全文
posted @ 2019-05-04 12:14 cxc1357
阅读(1090)
评论(0)
推荐(0)
[刷题] PTA 02-线性结构4 Pop Sequence
摘要: 模拟栈进出 方法一: 1 #include<stdio.h> 2 #define MAXSIZE 1000 3 4 typedef struct{ 5 int data[MAXSIZE]; 6 int top; 7 }SqStack; 8 9 int InitStack(SqStack *s){ 1
阅读全文
posted @ 2019-05-04 11:18 cxc1357
阅读(226)
评论(0)
推荐(0)
2019年5月3日
[算法] 队列
摘要: 循环队列(数组实现) 1 #include<stdio.h> 2 #include<stdlib.h> 3 typedef int ElementType; 4 typedef int Position; 5 typedef struct QNode * PtrToQNode; 6 struct Q
阅读全文
posted @ 2019-05-03 23:19 cxc1357
阅读(136)
评论(0)
推荐(0)
[算法] 堆栈
摘要: 顺序存储实现: 1 #include<stdio.h> 2 #include<stdlib.h> 3 4 typedef int Position; 5 typedef int ElementType; 6 typedef struct SNode *PtrToSNode; 7 struct SNo
阅读全文
posted @ 2019-05-03 22:38 cxc1357
阅读(186)
评论(0)
推荐(0)
上一页
1
···
47
48
49
50
51
52
53
54
55
···
59
下一页
公告