2021年1月14日

PTA 6-13 折半查找

摘要: 解题的关键是理解题目定义的线性表,这个表下标是从1开始的,所以折半查找的low和high也必须从1和length开始 #include <iostream> using namespace std; #define MAXSIZE 50 typedef int KeyType; typedef st 阅读全文

posted @ 2021-01-14 22:51 letwant 阅读(223) 评论(0) 推荐(0) 编辑

PTA 6-9 统计个位数字 (15分)

摘要: 这题的解决方法和保存1000!的方法类似,核心代码是j = i % 10,i /= 10; #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int Count_Digit(const int N, const int D); int main() 阅读全文

posted @ 2021-01-14 15:53 letwant 阅读(249) 评论(0) 推荐(0) 编辑

导航