- 博客(8)
- 收藏
- 关注
转载 C语言文件操作
一:打开文件句柄 //参数1:文件路径 //参数2:文件打开模式 函数执行成功返回文件流指针,错误返回NULL。 FILE *fopen(const char *path, const char *mode); 模式 操作 区别 文件要求 r 读 从文件头开始 文件需存在 r+ 读写 从文件
2021-06-07 14:20:12
282
原创 PAT 1019 General Palindromic Number
PAT 1019 General Palindromic Number 题目 PAT 1019 General Palindromic Number 题解 本题难度不大,主要是考察了一个进制转换问题,请参照我的另一博客 r进制转换 代码 #include <stdio.h> #include <iostream> using namespace std; int main(){ int N,b; cin>>N>>b; int z[100];
2021-06-06 22:35:54
126
原创 r进制转换
如何实现将a转换为r进制数 在我们的编码中经常会遇到如何进行进制之间的转换,那么我们如何快速地将进制转换并且存贮呢? 代码如下: z[num++]=n%r; n/=r; 在这里,我们采用了数组对转换后的数值进行存储,其中num初始为零,为元素个数,z为用以计数的数组,n为原始数据,r为需要转换的进制 ...
2021-06-06 22:13:09
728
原创 如何将单链表反向输出
链表——如何将单链表反向输出 方法一 将单链表反置再输出,此方法比较繁琐 方法二 将单链表输出到栈内,再逐个将栈弹出,此方法需要占用额外的空间 方法三 使用递归,内层不断嵌套,此方法空间复杂度较高 ...
2021-06-06 21:39:35
653
原创 PAT 1015 Reversible Primes
PAT 1015 Reversible Primes 题目 1015 Reversible Primes (20 分) A reversible prime in any number system is a prime whose “reverse” in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also
2021-06-04 10:13:04
199
原创 PAT 1011 World Cup Betting
PAT 1011 World Cup Betting 问题 1011 World Cup Betting (20 point(s)) With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South
2021-05-25 17:58:21
163
1
原创 PAT 1008 Elevator
PAT甲级1008 Elevator 链接地址:PAT Elevator 原题: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move
2021-05-15 23:34:58
209
6
原创 完美立方
A-完美立方 题目介绍: For hundreds of years Fermat’s Last Theorem, which stated simply that for n > 2 there exist no integers a, b, c > 1 such that a^n = b^n + c^n, has remained elusively unproven. (A re...
2020-02-26 00:12:02
504
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅