![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codewars刷题
C++程序源
这个作者很懒,什么都没留下…
展开
-
在codewars的第30题
在codewars的第30题Loading Kata: Validate Credit Card Number给定最多16位数的正整数,true如果它是有效的信用卡号,false则返回,如果不是,则返回。1.从右边第二个数字开始,每隔一个数字 *2,2.轮询每个数字如果大于9则减去93.计算每个数字之和4.判断数字之和是否能被10整除.#include <algorithm&g...原创 2019-08-08 20:24:26 · 220 阅读 · 0 评论 -
Longest Common Subsequence (Performance version)翻译(最长公共子序列(性能版本))
codewars第29题 最长的共同子序列(LCS)问题是找到一组序列中所有序列共有的最长子序列的问题。它不同于寻找共同子串的问题:与子串不同,子序列不需要占据原始序列内的连续位置。任务编写一个lcs接受两个strings 的函数,并返回它们最长的公共子序列.例如: &n...原创 2019-08-08 20:47:15 · 234 阅读 · 0 评论 -
Rail Fence Cipher: Encoding and Decoding
Create two functions to encode and then decode a string using the RailFence Cipher. This cipher is used to encode a string by placing eachcharacter successively in a diagonal along a set of “rails”...原创 2019-08-13 20:39:03 · 1415 阅读 · 0 评论 -
Square into Squares. Protect trees!
My little sister came back home from school with the following task:given a squared sheet of paper she has to cut it in pieces which, whenassembled, give squares the sides of which form an increasi...原创 2019-08-10 15:20:27 · 413 阅读 · 0 评论 -
A*算法的简单实现
#include <iostream>#include <string>#include <vector>#include <algorithm>#include <math.h>using namespace std;class CPoint{public: CPoint() { m_row = 0; m_c...原创 2019-08-10 15:22:14 · 134 阅读 · 0 评论 -
Divide integers as strings
Given positive integers a and b as strings, evaluate a / b and returnthe quotient and the remainder as strings in the form [quotient,remainder] (vector {quotient, remainder} in C++).a and b can be...原创 2019-08-14 22:37:55 · 223 阅读 · 0 评论 -
数学表达式解析器实现(Evaluate mathematical expression)
Instructions Given a mathematical expression as a string you mustreturn the result as a number.Numbers Number may be both whole numbers and/or decimal numbers. Thesame goes for the returned result...原创 2019-08-17 14:54:48 · 1326 阅读 · 0 评论