牛客104267433号
牛客104267433号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客104267433号的博客
TA的专栏
7篇文章
0人订阅
C语言练习
7篇文章
310人学习
全部文章
(共25篇)
题解 | #二叉树遍历#
#include <stdio.h> typedef char BTDataType; typedef struct BinaryTreeNode { BTDataType data; struct BinaryTreeNode* left; struct BinaryTreeN...
2024-08-31
0
87
题解 | #链表的回文结构#中间节点的查找+链表逆转
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) {} };*/ class PalindromeList { public: bool ...
2024-08-19
0
89
题解 | #链表分割#
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) {} };*/ #include <cstdlib> class Partition...
2024-08-19
0
95
题解 | #获得月份天数#
#include <stdio.h> /* 判断是否为闰年 参数表:year年份 返回值:1是 0否 */ int IsLeapYear(const int year) { if ((year % 400 == 0) || (year % 4 == 0 && year...
2024-04-27
0
153
题解 | #序列中删除指定数字#
#include <stdio.h> int main() { int arr[50] = {0}; int size = 0; int num = 0;//要删除的整数 int*p = arr; int count = 0;//记录该数字出现的...
2024-04-26
0
166
题解 | #矩阵相等判定#
#include <stdio.h> /* 判断两个同型矩阵是否相等 参数表:arr1矩阵1 arr2矩阵2 n行数 m列数 返回值:1相等 0不相等 */ int IsMatricesEqual(const int arr1[10][10], const int arr2[10][1...
2024-04-24
0
176
题解 | #变种水仙花#
#include <stdio.h> #include <math.h> int IsLilyNumber(int num) { int flag = 0; int sum = 0; for(int i = 1; num / (int)pow(10...
2024-04-16
0
162
题解 | #三角形判断#
#include <stdio.h> /* 三角形判断:任意两边之和大于第三边(任意两边只差小于第三边) 参数表: a,b,c 分别对应三角形的三边 */ void IsTriangle(double a, double b, double c) { if(a+b > c...
2024-04-16
0
161
题解 | #小乐乐走台阶#
#include <stdio.h> int Fibonacci(int num) { int a = 1;//1个台阶的方法数,用于存放 走num-2个台阶 的方法数 int b = 2;//2分台阶的方法数,用于存放 走num-1个台阶 的方法数 int c...
2024-04-16
0
142
题解 | #有序序列合并#
#include <stdio.h> /* 将两个升序排序的序列合并为一个有序序列 参数表: size1 待合并数组arr1的大小 size2 待合并数组arr2的大小 mergeArr 用于记录合并后的数组 */ void MergeArr(int arr1[], int size1...
2024-04-16
0
174
首页
上一页
1
2
3
下一页
末页