![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
衔接程序设计与数据结构
心中有光,不惧路长
这个作者很懒,什么都没留下…
展开
-
栈和队列的应用——回文数判断
前言用栈和队列实现回文数判断代码及易错点说明库函数调用及栈和队列相应结构体声明#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>typedef char DataType;//队列数据元素结构typedef struct node { DataType info; struct node *next;} QueueData;ty原创 2021-12-26 18:08:20 · 5475 阅读 · 1 评论 -
【freecodecamp】js基础学习总结
写在最前面:这是我个人学习过程中的随手记录,更多是写给自己看的,而且时间跨度比较大,内容的逻辑性、表述的准确性等等各方面还有所欠缺,希望能刷到这篇文章的小伙伴不要笑话。有发现错误也欢迎批评指正呀~大家一起学习,一起进步!js基础关于定义内容中带引号的字符串,两种方法在内容中的引号之前加 “\” 注意:!!!千万不要写成"/"用单引号定义,但是要注意引号匹配问题字符串更改不能只靠改变??(在js中这个叫Bracket Notation?不懂括号计法这个直译是什么意思)的第0个元素,要原创 2021-11-20 22:31:30 · 699 阅读 · 0 评论 -
【freecodecamp】Apply Functional Programming to Convert Strings to URL Slugs
一 我被这个关卡卡住的问题urlSlug(" Winter Is Coming") should return the string “winter-is-coming”.(即原字符串中的开头结尾的空格也要去掉)二 我的解决方案function urlSlug(title) {let tmp=title.toLowerCase().split(" ");let goal=tmp.filter(item=>item!=='').join("-");return goal;}三 思路原创 2021-11-20 21:53:00 · 322 阅读 · 0 评论 -
【freecodecamp学习笔记】where do I belong
一 题目Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted. The returned value should be a number.二 代码function getIndexToIns(arr, num) { arr.push(num); arr.sort(function(a原创 2021-11-19 21:04:27 · 317 阅读 · 0 评论 -
【freecodecamp】Finders Keepers
题目Create a function that looks through an array arr and returns the first element in it that passes a ‘truth test’. This means that given an element x, the ‘truth test’ is passed if func(x) is true. If no element passes the test, return undefined.题解func原创 2021-11-18 11:38:09 · 146 阅读 · 0 评论 -
【freecodecamp】confirm the ending
前言判断字符串str是否由target字符串结尾可直接调用js中的endsWith(str)函数,如果是自己实现这个函数功能,代码如下:题解function confirmEnding(str, target) { let test=str.substr(str.length-target.length,str.length-1); if(test===target) return true; else return false;}confirmEnding("Bastian原创 2021-11-18 10:52:36 · 195 阅读 · 0 评论 -
百钱买百鸡问题
目录题目简介代码描述思路简介题目描述古代数学家张丘建在《算经》一书中曾提出过著名的“百钱买百鸡”问题,该问题叙述如下:鸡翁一,值钱五;鸡母一,值钱三;鸡雏三,值钱一;百钱买百鸡,则翁、母、雏各几何?本关任务:编写一个程序能输出百钱买百鸡的所有可能组合。代码描述int main(){int i,j;int temp,sum;for(i=0;i<=20;i++){for(j=0;j<=33;j++){temp=(100-5*i-3*j)*3;sum=i+j+temp;原创 2021-08-24 21:50:54 · 134 阅读 · 0 评论