![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习笔记
文章平均质量分 56
z_y_ning
时间从不停息它的脚步,我们不是在追赶,是在沉淀。
展开
-
codewars5 Replace With Alphabet Position
InstructionsWelcome.In this kata you are required to, given a string, replace every letter with its position in the alphabet.If anything in the text isn’t a letter, ignore it and don’t return it.“...原创 2019-10-14 19:47:36 · 190 阅读 · 0 评论 -
codewars4 Credit Card Mask
InstructionsUsually when you buy something, you’re asked whether your credit card number, phone number or answer to your most secret question is still correct. However, since someone could look over ...原创 2019-10-11 20:31:14 · 204 阅读 · 0 评论 -
codewars3 Who likes it?
InstructionsYou probably know the “like” system from Facebook and other pages. People can “like” blog posts, pictures or other items. We want to create the text that should be displayed next to such ...原创 2019-10-11 16:31:49 · 229 阅读 · 0 评论 -
codewars2 Shortest Word
InstructionsSimple, given a string of words, return the length of the shortest word(s).String will never be empty and you do not need to account for different data types.solution:def find_short(s)...原创 2019-10-11 16:12:43 · 207 阅读 · 0 评论 -
codewars1 调整句子顺序
IntroductionYour task is to sort a given string. Each word in the string will contain a single number. This number is the position the word should have in the result.Note: Numbers can be from 1 to 9...原创 2019-10-11 15:06:15 · 207 阅读 · 0 评论 -
绝对路径问题
在Python 3.7.3 Shell中尝试书中绝对文件路径的代码,将文件放到桌面调用,翻查网上各种说法,写出以下四种类型的结果:除了第三种提示错误其它全部正常输出。还有很多问题来源于单词拼错,一定注意。...原创 2019-09-24 17:17:39 · 131 阅读 · 0 评论 -
类部分形式总结
一、类的声明和对象的定义1.1 声明类(1)一般形式class 类名{ private: 成员数据和成员函数 protect: 成员数据和成员函数 public: 成员数据和成员函数};(2)另一种形式类的成员函数完整地包含在类体内部,称为内联成员函数。(3)类体外的成员函数函数类型 类名::函数名(参数列...原创 2019-02-26 21:14:51 · 153 阅读 · 0 评论 -
编程艺术与实战——数列运算问题
一、计算1~n之间所有整数之和,其中n为正整数并由键盘输出。通过此例练习三种循环结构,依次写出三种方案实现。1 for循环 #include<iostream> using namespace std; int main() { int sum=0;//存储整数和 int n;//存储整数个数 cout &amp原创 2018-11-23 21:31:56 · 229 阅读 · 0 评论 -
构造函数——拷贝构造函数
构造函数可以分为三类(1)不带参数的构造函数:在函数体中对数据成员赋初值,这种方式使该类的每一个对象都得到同一组初值;(2)带参数的构造函数:如果用户希望对不同的对象赋不同的初值,可以采用带参数的构造函数。在调用不同对象的构造函数时从外面将不同的数据传递给构造函数,以实现初始化;(3)复制构造函数:构造函数可以带上参数,这些参数可以是整形、字符型等,也可以是一个对象类型,让它构造一个相同的对...原创 2018-11-15 17:00:32 · 209 阅读 · 0 评论 -
小总结之99乘法表——格式控制
@[小总结之99乘法表——格式控制碰到的题目如下:编程实现:输出九九乘法表,有具体的格式要求。先展示一下菜鸟本人的程序:#includeusing namespace std;void main(void){for (int i = 1; i <= 9; i++){for (int j = i; j <= 9; j++)cout << i &am原创 2018-09-19 20:45:11 · 976 阅读 · 1 评论 -
小总结之switch语句——范围划分
@小总结之switch语句——范围划分碰到的题目如下:编程实现:为某个学生写评语,要求从键盘输入该学生的学号和百分制成绩,并将百分制成绩转换成4级制输出。百分之成绩与四级制等级的对应关系如下,输入和输出要求如下。等级 分数段A 100~90B 89~80C 79~60D 60分...原创 2018-09-19 17:23:59 · 17690 阅读 · 2 评论